public class BatchWriterConfig extends Object implements org.apache.hadoop.io.Writable
BatchWriter
Constructor and Description |
---|
BatchWriterConfig() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Durability |
getDurability() |
long |
getMaxLatency(TimeUnit timeUnit) |
long |
getMaxMemory() |
int |
getMaxWriteThreads() |
long |
getTimeout(TimeUnit timeUnit) |
int |
hashCode() |
void |
readFields(DataInput in) |
BatchWriterConfig |
setDurability(Durability durability)
Change the durability for the BatchWriter session.
|
BatchWriterConfig |
setMaxLatency(long maxLatency,
TimeUnit timeUnit)
Sets the maximum amount of time to hold the data in memory before flushing it to servers.
For no maximum, set to zero, or Long.MAX_VALUE with TimeUnit.MILLISECONDS . |
BatchWriterConfig |
setMaxMemory(long maxMemory)
Sets the maximum memory to batch before writing.
|
BatchWriterConfig |
setMaxWriteThreads(int maxWriteThreads)
Sets the maximum number of threads to use for writing data to the tablet servers.
|
BatchWriterConfig |
setTimeout(long timeout,
TimeUnit timeUnit)
Sets the maximum amount of time an unresponsive server will be re-tried.
|
String |
toString() |
void |
write(DataOutput out) |
public BatchWriterConfig setMaxMemory(long maxMemory)
BatchWriter
will write.BatchWriter.flush()
after each added mutation. Must be non-negative.
Default: 50M
maxMemory
- max size in bytesthis
to allow chaining of set methodsIllegalArgumentException
- if maxMemory
is less than 0public BatchWriterConfig setMaxLatency(long maxLatency, TimeUnit timeUnit)
Long.MAX_VALUE
with TimeUnit.MILLISECONDS
.
TimeUnit.MICROSECONDS
or TimeUnit.NANOSECONDS
will be truncated to the nearest TimeUnit.MILLISECONDS
.
If this truncation would result in making the value zero when it was specified as non-zero, then a minimum value of one TimeUnit.MILLISECONDS
will
be used.
Default: 120 seconds
maxLatency
- the maximum latency, in the unit specified by the value of timeUnit
timeUnit
- determines how maxLatency
will be interpretedthis
to allow chaining of set methodsIllegalArgumentException
- if maxLatency
is less than 0public BatchWriterConfig setTimeout(long timeout, TimeUnit timeUnit)
BatchWriter
should throw an exception.Long.MAX_VALUE
with TimeUnit.MILLISECONDS
.
TimeUnit.MICROSECONDS
or TimeUnit.NANOSECONDS
will be truncated to the nearest TimeUnit.MILLISECONDS
.
If this truncation would result in making the value zero when it was specified as non-zero, then a minimum value of one TimeUnit.MILLISECONDS
will
be used.
Default: Long.MAX_VALUE
(no timeout)
timeout
- the timeout, in the unit specified by the value of timeUnit
timeUnit
- determines how timeout
will be interpretedthis
to allow chaining of set methodsIllegalArgumentException
- if timeout
is less than 0public BatchWriterConfig setMaxWriteThreads(int maxWriteThreads)
Default: 3
maxWriteThreads
- the maximum threads to usethis
to allow chaining of set methodsIllegalArgumentException
- if maxWriteThreads
is non-positivepublic long getMaxMemory()
public long getMaxLatency(TimeUnit timeUnit)
public long getTimeout(TimeUnit timeUnit)
public int getMaxWriteThreads()
public Durability getDurability()
public BatchWriterConfig setDurability(Durability durability)
durability
- the Durability to be used by the BatchWriterpublic void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Copyright © 2011–2017 The Apache Software Foundation. All rights reserved.