部署了hbase权威指南中的RowCount例子,然后代码中运行
HTable table = new HTable("test_endpoint_table");
try {
Map[b] results = table.coprocessorExec(RowCountProtocol.class, Bytes.toBytes("312321"), Bytes.toBytes("312321"),
new Batch.Call() {
@Override
public Long call(RowCountProtocol counter) throws IOException {
return counter.getRowCount();
}
});
long total = 0;
for (Map.Entry[b] 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[b] results = table.coprocessorExec(RowCountProtocol.class, null, null,
new Batch.Call() {
@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
请问这是为什么?
|