Interface AsyncConnection

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

@Public public interface AsyncConnection extends Closeable
The asynchronous version of Connection.
Since:
2.0.0
  • Method Details

    • 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.

    • getRegionLocator

      Retrieve a AsyncRegionLocator implementation to inspect region information on a table. The returned AsyncRegionLocator is not thread-safe, so a new instance should be created for each using thread. This is a lightweight operation. Pooling or caching of the returned AsyncRegionLocator is neither required nor desired.
      Parameters:
      tableName - Name of the table who's region is to be examined
      Returns:
      An AsyncRegionLocator instance
    • clearRegionLocationCache

      Clear all the entries in the region location cache, for all the tables.

      If you only want to clear the cache for a specific table, use AsyncTableRegionLocator.clearRegionLocationCache().

      This may cause performance issue so use it with caution.

    • getTable

      Retrieve an AsyncTable implementation for accessing a table.

      The returned instance will use default configs. Use getTableBuilder(TableName) if you want to customize some configs.

      This method no longer checks table existence. An exception will be thrown if the table does not exist only when the first operation is attempted.

      The returned CompletableFuture will be finished directly in the rpc framework's callback thread, so typically you should not do any time consuming work inside these methods. And also the observer style scan API will use AdvancedScanResultConsumer which is designed for experts only. Only use it when you know what you are doing.

      Parameters:
      tableName - the name of the table
      Returns:
      an AsyncTable to use for interactions with this table
      See Also:
    • getTableBuilder

      Returns an AsyncTableBuilder for creating AsyncTable.

      This method no longer checks table existence. An exception will be thrown if the table does not exist only when the first operation is attempted.

      Parameters:
      tableName - the name of the table
    • getTable

      Retrieve an AsyncTable implementation for accessing a table.

      This method no longer checks table existence. An exception will be thrown if the table does not exist only when the first operation is attempted.

      Parameters:
      tableName - the name of the table
      pool - the thread pool to use for executing callback
      Returns:
      an AsyncTable to use for interactions with this table
    • getTableBuilder

      Returns an AsyncTableBuilder for creating AsyncTable.

      This method no longer checks table existence. An exception will be thrown if the table does not exist only when the first operation is attempted.

      Parameters:
      tableName - the name of the table
      pool - the thread pool to use for executing callback
    • getAdmin

      default AsyncAdmin getAdmin()
      Retrieve an AsyncAdmin implementation to administer an HBase cluster.

      The returned instance will use default configs. Use getAdminBuilder() if you want to customize some configs.

      The admin operation's returned CompletableFuture will be finished directly in the rpc framework's callback thread, so typically you should not do any time consuming work inside these methods.

      Returns:
      an AsyncAdmin instance for cluster administration
    • getAdminBuilder

      Returns an AsyncAdminBuilder for creating AsyncAdmin.

      The admin operation's returned CompletableFuture will be finished directly in the rpc framework's callback thread, so typically you should not do any time consuming work inside these methods.

    • getAdmin

      Retrieve an AsyncAdmin implementation to administer an HBase cluster.

      The returned instance will use default configs. Use getAdminBuilder(ExecutorService) if you want to customize some configs.

      Parameters:
      pool - the thread pool to use for executing callback
      Returns:
      an AsyncAdmin instance for cluster administration
    • getAdminBuilder

      Returns an AsyncAdminBuilder for creating AsyncAdmin.
      Parameters:
      pool - the thread pool to use for executing callback
    • getBufferedMutator

      Retrieve an AsyncBufferedMutator for performing client-side buffering of writes.

      The returned instance will use default configs. Use getBufferedMutatorBuilder(TableName) if you want to customize some configs.

      Parameters:
      tableName - the name of the table
      Returns:
      an AsyncBufferedMutator for the supplied tableName.
    • getBufferedMutatorBuilder

      Parameters:
      tableName - the name of the table
    • getBufferedMutator

      Retrieve an AsyncBufferedMutator for performing client-side buffering of writes.

      The returned instance will use default configs. Use getBufferedMutatorBuilder(TableName, ExecutorService) if you want to customize some configs.

      Parameters:
      tableName - the name of the table
      pool - the thread pool to use for executing callback
      Returns:
      an AsyncBufferedMutator for the supplied tableName.
    • getBufferedMutatorBuilder

      Parameters:
      tableName - the name of the table
      pool - the thread pool to use for executing callback
    • isClosed

      boolean isClosed()
      Returns whether the connection is closed or not.
      Returns:
      true if this connection is closed
    • getHbck

      @LimitedPrivate("HBCK") CompletableFuture<Hbck> getHbck()
      Retrieve an Hbck implementation to fix an HBase cluster. The returned Hbck is not guaranteed to be thread-safe. A new instance should be created by each thread. This is a lightweight operation. Pooling or caching of the returned Hbck instance is not recommended.

      The caller is responsible for calling Closeable.close() on the returned Hbck instance.

      This will be used mostly by hbck tool.

      Returns:
      an Hbck instance for active master. Active master is fetched from the zookeeper.
    • getHbck

      @LimitedPrivate("HBCK") Hbck getHbck(ServerName masterServer) throws IOException
      Retrieve an Hbck implementation to fix an HBase cluster. The returned Hbck is not guaranteed to be thread-safe. A new instance should be created by each thread. This is a lightweight operation. Pooling or caching of the returned Hbck instance is not recommended.

      The caller is responsible for calling Closeable.close() on the returned Hbck instance.

      This will be used mostly by hbck tool. This may only be used to by pass getting registered master from ZK. In situations where ZK is not available or active master is not registered with ZK and user can get master address by other means, master can be explicitly specified.

      Parameters:
      masterServer - explicit ServerName for master server
      Returns:
      an Hbck instance for a specified master server
      Throws:
      IOException