Package org.apache.hadoop.hbase.util
Class MultiHConnection
java.lang.Object
org.apache.hadoop.hbase.util.MultiHConnection
Provides ability to create multiple Connection instances and allows to process a batch of actions
 using CHTable.doBatchWithCallback()
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate ExecutorServiceprivate Connection[]private final Objectprivate static final org.slf4j.Loggerprivate final int
- 
Constructor SummaryConstructorsConstructorDescriptionMultiHConnection(org.apache.hadoop.conf.Configuration conf, int noOfConnections) Create multiple Connection instances and initialize a thread pool executor
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close the open connections and shutdown the batchpoolprivate voidcreateBatchPool(org.apache.hadoop.conf.Configuration conf) <R> voidprocessBatchCallback(List<? extends Row> actions, TableName tableName, Object[] results, Batch.Callback<R> callback) Randomly pick a connection and process the batch of actions for a given table
- 
Field Details- 
LOG
- 
connections
- 
connectionsLock
- 
noOfConnections
- 
batchPool
 
- 
- 
Constructor Details- 
MultiHConnectionpublic 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- 
closeClose the open connections and shutdown the batchpool
- 
processBatchCallbackpublic <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
 
-