Class MultiHConnection

java.lang.Object
org.apache.hadoop.hbase.util.MultiHConnection

@Private public class MultiHConnection extends Object
Provides ability to create multiple Connection instances and allows to process a batch of actions using CHTable.doBatchWithCallback()
  • Field Details

  • Constructor Details

    • MultiHConnection

      public MultiHConnection(org.apache.hadoop.conf.Configuration conf, int noOfConnections) throws IOException
      Create multiple Connection instances and initialize a thread pool executor
      Parameters:
      conf - configuration
      noOfConnections - total no of Connections to create
      Throws:
      IOException - if IO failure occurs
  • Method Details

    • close

      public void close()
      Close the open connections and shutdown the batchpool
    • processBatchCallback

      public <R> void processBatchCallback(List<? extends Row> actions, TableName tableName, Object[] results, Batch.Callback<R> callback) throws IOException
      Randomly pick a connection and process the batch of actions for a given table
      Parameters:
      actions - the actions
      tableName - table name
      results - the results array
      callback - to run when results are in
      Throws:
      IOException - If IO failure occurs
    • createBatchPool

      private void createBatchPool(org.apache.hadoop.conf.Configuration conf)