Hbase Coprocessor求助

[复制链接]
查看11 | 回复1 | 2021-1-27 06:11:03 | 显示全部楼层 |阅读模式
部署了hbase权威指南中的RowCount例子,然后代码中运行
HTabletable=newHTable("test_endpoint_table");
try{
Mapresults=table.coprocessorExec(RowCountProtocol.class,Bytes.toBytes("312321"),Bytes.toBytes("312321"),
newBatch.Call(){
@Override
publicLongcall(RowCountProtocolcounter)throwsIOException{
returncounter.getRowCount();
}
});
longtotal=0;
for(Map.Entryentry:results.entrySet()){
total+=entry.getValue().longValue();
System.out.println("Region:"+Bytes.toString(entry.getKey())+",Count:"
+entry.getValue());
}
System.out.println("TotalCount:"+total);
输出的却是没有start和endrow的所有行数.
Region:test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df.,Count:3
TotalCount:3
Region:test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df.,Count:311963
TotalkeyvalueCount:311963
Mapresults=table.coprocessorExec(RowCountProtocol.class,null,null,
newBatch.Call(){
@Override
publicLongcall(RowCountProtocolcounter)throwsIOException{
returncounter.getRowCount();
}
});这样输出的也是
Region:test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df.,Count:3
TotalCount:3
Region:test_endpoint_table,,1341755395565.fd61efab9dc08cafeda0886ea80752df.,Count:311963
TotalkeyvalueCount:311963
请问这是为什么?
分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:11:03 | 显示全部楼层
http://blog.csdn.net/tntzbzc/article/details/8915101
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行