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
FieldsModifier and TypeFieldDescriptionprivate static final Patternprivate final AtomicLongprivate final ConcurrentLinkedQueue<Pair<Mutation,Throwable>> private final Set<CompletableFuture<Void>>private final BufferedMutator.ExceptionListenerprivate static final org.slf4j.Loggerprivate final AsyncBufferedMutatorFields inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
CLASSNAME_KEY, MIN_WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS -
Constructor Summary
ConstructorsConstructorDescriptionBufferedMutatorOverAsyncBufferedMutator(AsyncBufferedMutator mutator, BufferedMutator.ExceptionListener listener) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Performs aBufferedMutator.flush()and releases any resources held.voidflush()Executes all the buffered, asynchronousMutationoperations and waits until they are done.org.apache.hadoop.conf.ConfigurationReturns theConfigurationobject used by this instance.private StringgetHostnameAndPort(Throwable error) getName()Gets the fully qualified table name instance of the table that this BufferedMutator writes to.Returns the rpc request attributes.longReturns the maximum size in bytes of the write buffer for this HTable.private voidvoidSend someMutations to the table.voidSends aMutationto the table.voidsetOperationTimeout(int timeout) Set operation timeout for this mutator instancevoidsetRpcTimeout(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, waitMethods inherited from interface org.apache.hadoop.hbase.client.BufferedMutator
disableWriteBufferPeriodicFlush, getMaxMutations, 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:BufferedMutatorGets the fully qualified table name instance of the table that this BufferedMutator writes to.- Specified by:
getNamein interfaceBufferedMutator
-
getConfiguration
Description copied from interface:BufferedMutatorReturns theConfigurationobject used by this instance.The reference returned is not a copy, so any change made to it will affect this instance.
- Specified by:
getConfigurationin interfaceBufferedMutator
-
mutate
Description copied from interface:BufferedMutatorSends aMutationto the table. The mutations will be buffered and sent over the wire as part of a batch. Currently only supportsPutandDeletemutations.- Specified by:
mutatein interfaceBufferedMutator- Parameters:
mutation- The data to send.- Throws:
IOException- if a remote or network exception occurs.
-
getHostnameAndPort
-
makeError
-
internalFlush
-
mutate
Description copied from interface:BufferedMutatorSend someMutations 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 ofmutationsin a single batch; it will be broken up according to the write buffer capacity.- Specified by:
mutatein interfaceBufferedMutator- Parameters:
mutations- The data to send.- Throws:
IOException- if a remote or network exception occurs.
-
close
Description copied from interface:BufferedMutatorPerforms aBufferedMutator.flush()and releases any resources held.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBufferedMutator- Specified by:
closein interfaceCloseable- Throws:
IOException- if a remote or network exception occurs.
-
flush
Description copied from interface:BufferedMutatorExecutes all the buffered, asynchronousMutationoperations and waits until they are done.- Specified by:
flushin interfaceBufferedMutator- Throws:
IOException- if a remote or network exception occurs.
-
getWriteBufferSize
Description copied from interface:BufferedMutatorReturns 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:
getWriteBufferSizein interfaceBufferedMutator- Returns:
- The size of the write buffer in bytes.
-
setRpcTimeout
Description copied from interface:BufferedMutatorSet rpc timeout for this mutator instance- Specified by:
setRpcTimeoutin interfaceBufferedMutator
-
setOperationTimeout
Description copied from interface:BufferedMutatorSet operation timeout for this mutator instance- Specified by:
setOperationTimeoutin interfaceBufferedMutator
-
getRequestAttributes
Description copied from interface:BufferedMutatorReturns the rpc request attributes.- Specified by:
getRequestAttributesin interfaceBufferedMutator
-