分享

Hbase Coprocessor求助

Nodic_Myth 发表于 2013-10-16 13:40:02 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 1 5906
部署了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
请问这是为什么?
              
               
               

已有(1)人评论

跳转到指定楼层
tntzbzc 发表于 2013-10-16 13:40:37
回复

使用道具 举报

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

本版积分规则

关闭

推荐上一条 /2 下一条