Hbase quickly count number of rows

前端 未结 12 1565
轮回少年
轮回少年 2020-12-04 13:25

Right now I implement row count over ResultScanner like this

for (Result rs = scanner.next(); rs != null; rs = scanner.next()) {
    number++;
}         


        
12条回答
  •  自闭症患者
    2020-12-04 13:53

    Go to Hbase home directory and run this command,

    ./bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter 'namespace:tablename'

    This will launch a mapreduce job and the output will show the number of records existing in the hbase table.

提交回复
热议问题