|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.client.BatchWriterConfig
public class BatchWriterConfig
This object holds configuration settings used to instantiate a BatchWriter
Constructor Summary | |
---|---|
BatchWriterConfig()
|
Method Summary | |
---|---|
long |
getMaxLatency(TimeUnit timeUnit)
|
long |
getMaxMemory()
|
int |
getMaxWriteThreads()
|
long |
getTimeout(TimeUnit timeUnit)
|
void |
readFields(DataInput in)
|
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. |
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BatchWriterConfig()
Method Detail |
---|
public BatchWriterConfig setMaxMemory(long maxMemory)
BatchWriter
will write.BatchWriter.flush()
after each added mutation. Must be non-negative.
Default: 50M
maxMemory
- max size in bytes
this
to allow chaining of set methods
IllegalArgumentException
- 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 interpreted
this
to allow chaining of set methods
IllegalArgumentException
- 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 interpreted
this
to allow chaining of set methods
IllegalArgumentException
- if timeout
is less than 0public BatchWriterConfig setMaxWriteThreads(int maxWriteThreads)
Default: 3
maxWriteThreads
- the maximum threads to use
this
to allow chaining of set methods
IllegalArgumentException
- if maxWriteThreads
is non-positivepublic long getMaxMemory()
public long getMaxLatency(TimeUnit timeUnit)
public long getTimeout(TimeUnit timeUnit)
public int getMaxWriteThreads()
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |