1

In order to get max throughoutput, I use batch puts and increments to put data into hbase, code sample:

Configuration configuration = HBaseConfiguration.create();
configuration.set("hbase.zookeeper.quorum", "10.2.1.12:2181");
configuration.set("hbase.zookeeper.znode.parent", "/hbase");
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = null;
try {
   table = connection.getTable(TableName.valueOf("test"));
   Object[] results = new Object[incrementList.size()];
   table.batch(incrementList, results);
   for (Object result : results) {
       if (null == result) {
           failed++;
       } else {
           //System.out.println("Batch operation result: " + result);
       }
   }
   System.out.println("Batch operation failed: " + failed);
} catch (Exception ex) {
   throw new RPCCallException("Hbase put error: " + ex.getMessage(), ex);
} finally {
   table.close();
}
connection.close();

There are 233 hconnections. and the thread stack: enter image description here

hbase-client version:

<dependency>
  <groupId>org.apache.hbase</groupId>
  <artifactId>hbase-client</artifactId>
  <version>1.3.0</version>
</dependency>
jamee
  • 553
  • 1
  • 5
  • 25

1 Answers1

3

I found the problem, the default config of thread pool of hbase connection is: core = max = 256, so the thread count will increase up to 256

jamee
  • 553
  • 1
  • 5
  • 25