我必须在一小时内非常频繁地扫描表格(〜百万次).我有关于rowid的信息(这是一个字节数组).我正在创建用于创建startrow和endrow的rowid,这在我的情况下基本相同.
public String someMethod(byte[] rowid){ if (aTable == null) { aTable = new HTable(Config.getHadoopConfig(), Config.getATable()); } byte[] endRow = new byte[rowId.length]; endrow = System.copyArray(rowId, 0, endRow, 0, rowId.length) Scan scan = new Scan(rowId , endRow) //scanner implementation and iteration over the result (ResultScanner result = aTable.getScanner(scan);) { for (Result item : result) { } } }
我想知道我是否可以实现一些连接池来提高性能.是否存在HBase Java API中可用的任何池化机制.我使用的是0.96.x版本的HBase.此外,是否有任何配置设置可以提高性能.谢谢