org.apache.hadoop.hbase.util
Class MultiHConnection

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

@InterfaceAudience.Private
public class MultiHConnection
extends Object

Provides ability to create multiple HConnection instances and allows to process a batch of actions using HConnection.processBatchCallback()


Constructor Summary
MultiHConnection(org.apache.hadoop.conf.Configuration conf, int noOfConnections)
          Create multiple HConnection instances and initialize a thread pool executor
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiHConnection

public MultiHConnection(org.apache.hadoop.conf.Configuration conf,
                        int noOfConnections)
                 throws IOException
Create multiple HConnection instances and initialize a thread pool executor

Parameters:
conf - configuration
noOfConnections - total no of HConnections to create
Throws:
IOException
Method Detail

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 -
Throws:
IOException
InterruptedException


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.