Package org.apache.hadoop.hbase.client
Class BufferedMutatorOverAsyncBufferedMutator
java.lang.Object
org.apache.hadoop.hbase.client.BufferedMutatorOverAsyncBufferedMutator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BufferedMutator
BufferedMutator
implementation based on AsyncBufferedMutator
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
BufferedMutator.ExceptionListener
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Pattern
private final AtomicLong
private final ConcurrentLinkedQueue<Pair<Mutation,
Throwable>> private final Set<CompletableFuture<Void>>
private final BufferedMutator.ExceptionListener
private static final org.slf4j.Logger
private final AsyncBufferedMutator
Fields inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
CLASSNAME_KEY, MIN_WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS
-
Constructor Summary
ConstructorDescriptionBufferedMutatorOverAsyncBufferedMutator
(AsyncBufferedMutator mutator, BufferedMutator.ExceptionListener listener) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Performs aBufferedMutator.flush()
and releases any resources held.void
flush()
Executes all the buffered, asynchronousMutation
operations and waits until they are done.org.apache.hadoop.conf.Configuration
Returns theConfiguration
object used by this instance.private String
getHostnameAndPort
(Throwable error) getName()
Gets the fully qualified table name instance of the table that this BufferedMutator writes to.Returns the rpc request attributes.long
Returns the maximum size in bytes of the write buffer for this HTable.private void
void
Send someMutation
s to the table.void
Sends aMutation
to the table.void
setOperationTimeout
(int timeout) Set operation timeout for this mutator instancevoid
setRpcTimeout
(int timeout) Set rpc timeout for this mutator instanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
disableWriteBufferPeriodicFlush, getWriteBufferPeriodicFlushTimeoutMs, getWriteBufferPeriodicFlushTimerTickMs, setWriteBufferPeriodicFlush, setWriteBufferPeriodicFlush
-
Field Details
-
LOG
-
mutator
-
listener
-
futures
-
bufferedSize
-
errors
-
ADDR_MSG_MATCHER
-
-
Constructor Details
-
BufferedMutatorOverAsyncBufferedMutator
-
-
Method Details
-
getName
Description copied from interface:BufferedMutator
Gets the fully qualified table name instance of the table that this BufferedMutator writes to.- Specified by:
getName
in interfaceBufferedMutator
-
getConfiguration
Description copied from interface:BufferedMutator
Returns theConfiguration
object used by this instance.The reference returned is not a copy, so any change made to it will affect this instance.
- Specified by:
getConfiguration
in interfaceBufferedMutator
-
mutate
Description copied from interface:BufferedMutator
Sends aMutation
to the table. The mutations will be buffered and sent over the wire as part of a batch. Currently only supportsPut
andDelete
mutations.- Specified by:
mutate
in interfaceBufferedMutator
- Parameters:
mutation
- The data to send.- Throws:
IOException
- if a remote or network exception occurs.
-
getHostnameAndPort
-
makeError
-
internalFlush
-
mutate
Description copied from interface:BufferedMutator
Send someMutation
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 ofmutations
in a single batch; it will be broken up according to the write buffer capacity.- Specified by:
mutate
in interfaceBufferedMutator
- Parameters:
mutations
- The data to send.- Throws:
IOException
- if a remote or network exception occurs.
-
close
Description copied from interface:BufferedMutator
Performs aBufferedMutator.flush()
and releases any resources held.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBufferedMutator
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- if a remote or network exception occurs.
-
flush
Description copied from interface:BufferedMutator
Executes all the buffered, asynchronousMutation
operations and waits until they are done.- Specified by:
flush
in interfaceBufferedMutator
- Throws:
IOException
- if a remote or network exception occurs.
-
getWriteBufferSize
Description copied from interface:BufferedMutator
Returns the maximum size in bytes of the write buffer for this HTable.The default value comes from the configuration parameter
hbase.client.write.buffer
.- Specified by:
getWriteBufferSize
in interfaceBufferedMutator
- Returns:
- The size of the write buffer in bytes.
-
setRpcTimeout
Description copied from interface:BufferedMutator
Set rpc timeout for this mutator instance- Specified by:
setRpcTimeout
in interfaceBufferedMutator
-
setOperationTimeout
Description copied from interface:BufferedMutator
Set operation timeout for this mutator instance- Specified by:
setOperationTimeout
in interfaceBufferedMutator
-
getRequestAttributes
Description copied from interface:BufferedMutator
Returns the rpc request attributes.- Specified by:
getRequestAttributes
in interfaceBufferedMutator
-