@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 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) |
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
Mutation s to the table. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mutate
private final org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer periodicalFlushTimer
private final AsyncTable<?> table
private final long writeBufferSize
private final long periodicFlushTimeoutNs
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)
public TableName getName()
AsyncBufferedMutator
AsyncBufferedMutator
writes to.getName
in interface AsyncBufferedMutator
public org.apache.hadoop.conf.Configuration getConfiguration()
AsyncBufferedMutator
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 AsyncBufferedMutator
protected void internalFlush()
public List<CompletableFuture<Void>> mutate(List<? extends Mutation> mutations)
AsyncBufferedMutator
Mutation
s 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 AsyncBufferedMutator
mutations
- The data to send.public void flush()
AsyncBufferedMutator
flush
in interface AsyncBufferedMutator
public void close()
AsyncBufferedMutator
AsyncBufferedMutator.flush()
and releases any resources held.close
in interface Closeable
close
in interface AutoCloseable
close
in interface AsyncBufferedMutator
public long getWriteBufferSize()
AsyncBufferedMutator
The default value comes from the configuration parameter hbase.client.write.buffer
.
getWriteBufferSize
in interface AsyncBufferedMutator
public long getPeriodicalFlushTimeout(TimeUnit unit)
AsyncBufferedMutator
getPeriodicalFlushTimeout
in interface AsyncBufferedMutator
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.