AggregationClient aggregationClient = new AggregationClient(hbaseconfig);
Scan scan = new Scan();
scan.addFamily(Bytes.toBytes("fr"));
Date start = new Date();
long rowcount = aggregationClient.rowCount(TABLE_NAME,
new LongColumnInterpreter(), scan);
Date end = new Date();
System.out.println("rowcount:" + rowcount);
System.out.println("timecost:" + (end.getTime() - start.getTime()));
hbase shell添加coprocessor:
disable 'member'
alter 'member',METHOD => 'table_att','coprocessor' => 'hdfs://master24:9000/user/hadoop/jars/test.jar|mycoprocessor.SampleCoprocessor|1001|'
enable 'member'
hbase shell 删除coprocessor:
disable 'member'
alter 'member',METHOD => 'table_att_unset',NAME =>'coprocessor$1'