【发布时间】:2014-04-09 21:11:27
【问题描述】:
我已将 1M 行数据插入到 hbase 表中。然后我正在编写一个java程序来测试基于行键的HBase的读取性能。
//create a list which contains 10,000 row keys
for(int i=0; i<10000; i++)
{
list.add(rowkey);
}
//go through the list and check the rowkey exists in HBase or not
for(int i=0; i<list.size(); i++)
{
Get g = new Get(list.get(i));
g.setFilter(new KeyOnlyFilter());
Result r = table.get(g);
// ...
}
行键格式,如“12345_54321”。测试我的程序后,加载所有 10,000 个行键以检查它是否存在大约需要 50 秒,因此每 200/s。
这个读取性能太慢了,我还在Get对象中添加了过滤器。有没有其他方法可以提高上述性能?还是我的程序有问题?
【问题讨论】: