@InterfaceAudience.Private public class MultiHConnection extends Object
Constructor and Description |
---|
MultiHConnection(Configuration conf,
int noOfConnections)
Create multiple HConnection instances and initialize a thread pool executor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the open connections and shutdown the batchpool
|
<R> void |
processBatchCallback(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
|
public MultiHConnection(Configuration conf, int noOfConnections) throws IOException
conf
- configurationnoOfConnections
- total no of HConnections to createIOException
public void close()
public <R> void processBatchCallback(List<? extends Row> actions, TableName tableName, Object[] results, Batch.Callback<R> callback) throws IOException
actions
- the actionstableName
- table nameresults
- the results arraycallback
- IOException
InterruptedException