hbase 行计数方法一:
//行计数
public static long rowCount(String tableName) {
long rowCount = 0;
@SuppressWarnings("resource")
AggregationClient aggregationClient = new AggregationClient(conf);
Scan scan = new Scan();
try {
rowCount = aggregationClient.rowCount(TableName.valueOf(tableName),
new LongColumnInterpreter(), scan);
} catch (Throwable e) {
e.printStackTrace();
}
return rowCount;
}
注意这里有conf的配置和Scan的设置
转载于:https://blog.csdn.net/weixin_39928010/article/details/79550909