@InterfaceAudience.Private @InterfaceStability.Evolving public class BufferedMutatorImpl extends java.lang.Object implements BufferedMutator
Used to communicate with a single HBase table similar to HTable
but meant for batched, potentially asynchronous puts. Obtain an instance from
a Connection and call close() afterwards.
ConnectionFactory,
ConnectionBufferedMutator.ExceptionListener| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.hbase.client.AsyncProcess |
ap |
protected ClusterConnection |
connection |
protected long |
currentWriteBufferSize |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Performs a
BufferedMutator.flush() and releases any resources held. |
void |
flush()
Executes all the buffered, asynchronous
Mutation operations and waits until they
are done. |
Configuration |
getConfiguration()
Returns the
org.apache.hadoop.conf.Configuration object used by this instance. |
TableName |
getName()
Gets the fully qualified table name instance of the table that this BufferedMutator writes to.
|
java.util.List<Row> |
getWriteBuffer()
Deprecated.
Going away when we drop public support for
HTableInterface.
Ó |
long |
getWriteBufferSize()
Returns the maximum size in bytes of the write buffer for this HTable.
|
void |
mutate(java.util.List<? extends Mutation> ms)
Send some
Mutations to the table. |
void |
mutate(Mutation m)
Sends a
Mutation to the table. |
void |
setWriteBufferSize(long writeBufferSize)
Deprecated.
Going away when we drop public support for
HTableInterface. |
void |
validatePut(Put put) |
protected ClusterConnection connection
protected long currentWriteBufferSize
protected org.apache.hadoop.hbase.client.AsyncProcess ap
public TableName getName()
BufferedMutatorgetName in interface BufferedMutatorpublic Configuration getConfiguration()
BufferedMutatororg.apache.hadoop.conf.Configuration object used by this instance.
The reference returned is not a copy, so any change made to it will affect this instance.
getConfiguration in interface BufferedMutatorpublic void mutate(Mutation m) throws java.io.InterruptedIOException, RetriesExhaustedWithDetailsException
BufferedMutatorMutation to the table. The mutations will be buffered and sent over the
wire as part of a batch. Currently only supports Put and Delete mutations.mutate in interface BufferedMutatorm - The data to send.java.io.InterruptedIOExceptionRetriesExhaustedWithDetailsExceptionpublic void mutate(java.util.List<? extends Mutation> ms) throws java.io.InterruptedIOException, RetriesExhaustedWithDetailsException
BufferedMutatorMutations to the table. The mutations will be buffered and sent over the
wire as part of a batch. There is no guarantee of sending entire content of mutations
in a single batch; it will be broken up according to the write buffer capacity.mutate in interface BufferedMutatorms - The data to send.java.io.InterruptedIOExceptionRetriesExhaustedWithDetailsExceptionpublic void validatePut(Put put) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic void close()
throws java.io.IOException
BufferedMutatorBufferedMutator.flush() and releases any resources held.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface BufferedMutatorjava.io.IOException - if a remote or network exception occurs.public void flush()
throws java.io.InterruptedIOException,
RetriesExhaustedWithDetailsException
BufferedMutatorMutation operations and waits until they
are done.flush in interface BufferedMutatorjava.io.InterruptedIOExceptionRetriesExhaustedWithDetailsException@Deprecated
public void setWriteBufferSize(long writeBufferSize)
throws RetriesExhaustedWithDetailsException,
java.io.InterruptedIOException
HTableInterface.HTable.setWriteBufferSize(long) only. This ought
not be called for production uses.RetriesExhaustedWithDetailsExceptionjava.io.InterruptedIOExceptionpublic long getWriteBufferSize()
The default value comes from the configuration parameter hbase.client.write.buffer.
getWriteBufferSize in interface BufferedMutator@Deprecated public java.util.List<Row> getWriteBuffer()
HTableInterface.
ÓHTable.getWriteBuffer() only. This should not beÓ
called from production uses.