Interface AsyncBufferedMutator

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
AsyncBufferedMutatorImpl

@Public public interface AsyncBufferedMutator extends Closeable
Used to communicate with a single HBase table in batches. Obtain an instance from a AsyncConnection and call close() afterwards.

The implementation is required to be thread safe.

  • Method Details

    • getName

      Gets the fully qualified table name instance of the table that this AsyncBufferedMutator writes to.
    • getConfiguration

      org.apache.hadoop.conf.Configuration getConfiguration()
      Returns the Configuration object used by this instance.

      The reference returned is not a copy, so any change made to it will affect this instance.

    • mutate

      default CompletableFuture<Void> mutate(Mutation mutation)
      Sends a 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.
      Parameters:
      mutation - The data to send.
    • mutate

      List<CompletableFuture<Void>> mutate(List<? extends Mutation> mutations)
      Send some Mutations 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.
      Parameters:
      mutations - The data to send.
    • flush

      void flush()
      Executes all the buffered, asynchronous operations.
    • close

      void close()
      Performs a flush() and releases any resources held.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getWriteBufferSize

      Returns the maximum size in bytes of the write buffer.

      The default value comes from the configuration parameter hbase.client.write.buffer.

      Returns:
      The size of the write buffer in bytes.
    • getPeriodicalFlushTimeout

      default long getPeriodicalFlushTimeout(TimeUnit unit)
      Returns the periodical flush interval, 0 means disabled.