Hbase Coprocessor求助

Nodic_Myth 2012-07-10 09:41:45
部署了hbase权威指南中的RowCount例子,然后代码中运行
HTable table = new HTable("test_endpoint_table");

try {
Map<byte[], Long> results = table.coprocessorExec(RowCountProtocol.class, Bytes.toBytes("312321"), Bytes.toBytes("312321"),
new Batch.Call<RowCountProtocol, Long>() {
@Override
public Long call(RowCountProtocol counter) throws IOException {
return counter.getRowCount();
}
});

long total = 0;
for (Map.Entry<byte[], Long> entry : results.entrySet()) {
total += entry.getValue().longValue();
System.out.println("Region: " + Bytes.toString(entry.getKey()) + ", Count: "
+ entry.getValue());
}
System.out.println("Total Count: " + total);
输出的却是没有start和end row的所有行数.

Region: test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df., Count: 3
Total Count: 3
Region: test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df., Count: 311963
Total key value Count: 311963

Map<byte[], Long> results = table.coprocessorExec(RowCountProtocol.class, null, null,
new Batch.Call<RowCountProtocol, Long>() {
@Override
public Long call(RowCountProtocol counter) throws IOException {
return counter.getRowCount();
}
});这样输出的也是
Region: test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df., Count: 3
Total Count: 3
Region: test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df., Count: 311963
Total key value Count: 311963
请问这是为什么?
...全文
326 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

20,808

社区成员

发帖
与我相关
我的任务
社区描述
Hadoop生态大数据交流社区,致力于有Hadoop,hive,Spark,Hbase,Flink,ClickHouse,Kafka,数据仓库,大数据集群运维技术分享和交流等。致力于收集优质的博客
社区管理员
  • 分布式计算/Hadoop社区
  • 涤生大数据
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧