@InterfaceAudience.Private class BufferedMutatorOverAsyncBufferedMutator extends Object implements BufferedMutator
BufferedMutator
implementation based on AsyncBufferedMutator
.BufferedMutator.ExceptionListener
Modifier and Type | Field and Description |
---|---|
private static Pattern |
ADDR_MSG_MATCHER |
private AtomicLong |
bufferedSize |
private ConcurrentLinkedQueue<Pair<Mutation,Throwable>> |
errors |
private Set<CompletableFuture<Void>> |
futures |
private BufferedMutator.ExceptionListener |
listener |
private static org.slf4j.Logger |
LOG |
private AsyncBufferedMutator |
mutator |
CLASSNAME_KEY, MIN_WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS
Constructor and Description |
---|
BufferedMutatorOverAsyncBufferedMutator(AsyncBufferedMutator mutator,
BufferedMutator.ExceptionListener listener) |
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. |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns the
Configuration object used by this instance. |
private String |
getHostnameAndPort(Throwable error) |
TableName |
getName()
Gets the fully qualified table name instance of the table that this BufferedMutator writes to.
|
long |
getWriteBufferSize()
Returns the maximum size in bytes of the write buffer for this HTable.
|
private void |
internalFlush() |
private RetriesExhaustedWithDetailsException |
makeError() |
void |
mutate(List<? extends Mutation> mutations)
Send some
Mutation s to the table. |
void |
mutate(Mutation mutation)
Sends a
Mutation to the table. |
void |
setOperationTimeout(int timeout)
Set operation timeout for this mutator instance
|
void |
setRpcTimeout(int timeout)
Set rpc timeout for this mutator instance
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableWriteBufferPeriodicFlush, getWriteBufferPeriodicFlushTimeoutMs, getWriteBufferPeriodicFlushTimerTickMs, setWriteBufferPeriodicFlush, setWriteBufferPeriodicFlush
private static final org.slf4j.Logger LOG
private final AsyncBufferedMutator mutator
private final BufferedMutator.ExceptionListener listener
private final Set<CompletableFuture<Void>> futures
private final AtomicLong bufferedSize
private final ConcurrentLinkedQueue<Pair<Mutation,Throwable>> errors
private static final Pattern ADDR_MSG_MATCHER
BufferedMutatorOverAsyncBufferedMutator(AsyncBufferedMutator mutator, BufferedMutator.ExceptionListener listener)
public TableName getName()
BufferedMutator
getName
in interface BufferedMutator
public org.apache.hadoop.conf.Configuration getConfiguration()
BufferedMutator
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 BufferedMutator
public void mutate(Mutation mutation) throws IOException
BufferedMutator
Mutation
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 BufferedMutator
mutation
- The data to send.IOException
- if a remote or network exception occurs.private String getHostnameAndPort(Throwable error)
private RetriesExhaustedWithDetailsException makeError()
private void internalFlush() throws RetriesExhaustedWithDetailsException
public void mutate(List<? extends Mutation> mutations) throws IOException
BufferedMutator
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; it will be broken up according to the write buffer capacity.mutate
in interface BufferedMutator
mutations
- The data to send.IOException
- if a remote or network exception occurs.public void close() throws IOException
BufferedMutator
BufferedMutator.flush()
and releases any resources held.close
in interface Closeable
close
in interface AutoCloseable
close
in interface BufferedMutator
IOException
- if a remote or network exception occurs.public void flush() throws IOException
BufferedMutator
Mutation
operations and waits until they are
done.flush
in interface BufferedMutator
IOException
- if a remote or network exception occurs.public long getWriteBufferSize()
BufferedMutator
The default value comes from the configuration parameter hbase.client.write.buffer
.
getWriteBufferSize
in interface BufferedMutator
public void setRpcTimeout(int timeout)
BufferedMutator
setRpcTimeout
in interface BufferedMutator
public void setOperationTimeout(int timeout)
BufferedMutator
setOperationTimeout
in interface BufferedMutator
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.