部署了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
请问这是为什么?
分 -->
|