@InterfaceAudience.Private class AsyncBufferedMutatorImpl extends Object implements AsyncBufferedMutator
AsyncBufferedMutator. Simply wrap an AsyncTable.| Modifier and Type | Field and Description |
|---|---|
private long |
bufferedSize |
private boolean |
closed |
private List<CompletableFuture<Void>> |
futures |
private int |
maxKeyValueSize |
private List<Mutation> |
mutations |
private org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer |
periodicalFlushTimer |
(package private) org.apache.hbase.thirdparty.io.netty.util.Timeout |
periodicFlushTask |
private long |
periodicFlushTimeoutNs |
private AsyncTable<?> |
table |
private long |
writeBufferSize |
| Constructor and Description |
|---|
AsyncBufferedMutatorImpl(org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer periodicalFlushTimer,
AsyncTable<?> table,
long writeBufferSize,
long periodicFlushTimeoutNs,
int maxKeyValueSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Performs a
AsyncBufferedMutator.flush() and releases any resources held. |
void |
flush()
Executes all the buffered, asynchronous operations.
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns the
Configuration object used by this instance. |
TableName |
getName()
Gets the fully qualified table name instance of the table that this
AsyncBufferedMutator writes to. |
long |
getPeriodicalFlushTimeout(TimeUnit unit)
Returns the periodical flush interval, 0 means disabled.
|
long |
getWriteBufferSize()
Returns the maximum size in bytes of the write buffer.
|
protected void |
internalFlush() |
List<CompletableFuture<Void>> |
mutate(List<? extends Mutation> mutations)
Send some
Mutations to the table. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmutateprivate final org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer periodicalFlushTimer
private final AsyncTable<?> table
private final long writeBufferSize
private final long periodicFlushTimeoutNs
private final int maxKeyValueSize
private List<CompletableFuture<Void>> futures
private long bufferedSize
private boolean closed
org.apache.hbase.thirdparty.io.netty.util.Timeout periodicFlushTask
AsyncBufferedMutatorImpl(org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer periodicalFlushTimer, AsyncTable<?> table, long writeBufferSize, long periodicFlushTimeoutNs, int maxKeyValueSize)
public TableName getName()
AsyncBufferedMutatorAsyncBufferedMutator writes to.getName in interface AsyncBufferedMutatorpublic org.apache.hadoop.conf.Configuration getConfiguration()
AsyncBufferedMutatorConfiguration 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 AsyncBufferedMutatorprotected void internalFlush()
public List<CompletableFuture<Void>> mutate(List<? extends Mutation> mutations)
AsyncBufferedMutatorMutations 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, the implementations are free to break it up according to the write buffer
capacity.mutate in interface AsyncBufferedMutatormutations - The data to send.public void flush()
AsyncBufferedMutatorflush in interface AsyncBufferedMutatorpublic void close()
AsyncBufferedMutatorAsyncBufferedMutator.flush() and releases any resources held.close in interface Closeableclose in interface AutoCloseableclose in interface AsyncBufferedMutatorpublic long getWriteBufferSize()
AsyncBufferedMutator
The default value comes from the configuration parameter hbase.client.write.buffer.
getWriteBufferSize in interface AsyncBufferedMutatorpublic long getPeriodicalFlushTimeout(TimeUnit unit)
AsyncBufferedMutatorgetPeriodicalFlushTimeout in interface AsyncBufferedMutatorCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.