@InterfaceAudience.Private public class MultiHConnection extends Object
Constructor and Description |
---|
MultiHConnection(org.apache.hadoop.conf.Configuration conf,
int noOfConnections)
Create multiple Connection 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(org.apache.hadoop.conf.Configuration conf, int noOfConnections) throws IOException
conf
- configurationnoOfConnections
- total no of Connections to createIOException
- if IO failure occurspublic 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
- to run when results are inIOException
- If IO failure occursCopyright © 2007–2019 Cloudera. All rights reserved.