HBASE count方法总结

一. 用hbase自带的mapreduce程序来计算如下,

/usr/hdp/2.3.0.0-2557/hbase/bin
[root@node1 bin]# ./hbase org.apache.hadoop.hbase.mapreduce.RowCounter 'testtable0728'

计算结果如下:

2016-07-28 16:52:31,924 INFO  [main] mapreduce.Job:  map 0% reduce 0%
2016-07-28 16:53:41,616 INFO  [main] mapreduce.Job:  map 25% reduce 0%
2016-07-28 16:54:21,630 INFO  [main] mapreduce.Job:  map 50% reduce 0%
2016-07-28 16:55:11,663 INFO  [main] mapreduce.Job:  map 75% reduce 0%
2016-07-28 16:55:15,750 INFO  [main] mapreduce.Job:  map 100% reduce 0%
2016-07-28 16:55:16,798 INFO  [main] mapreduce.Job: Job job_1469584130491_0002 completed successfully
2016-07-28 16:55:17,263 INFO  [main] mapreduce.Job: Counters: 31
    File System Counters
        FILE: Number of bytes read=0
        FILE: Number of bytes written=620452
        FILE: Number of read operations=0
        FILE: Number of large read operations=0
        FILE: Number of write operations=0
        HDFS: Number of bytes read=816
        HDFS: Number of bytes written=0
        HDFS: Number of read operations=4
        HDFS: Number of large read operations=0
        HDFS: Number of write operations=0
    Job Counters 
        Launched map tasks=4
        Data-local map tasks=4
        Total time spent by all maps in occupied slots (ms)=987150
        Total time spent by all reduces in occupied slots (ms)=0
        Total time spent by all map tasks (ms)=493575
        Total vcore-seconds taken by all map tasks=493575
        Total megabyte-seconds taken by all map tasks=758131200
    Map-Reduce Framework
        Map input records=10103174
        Map output records=0
        Input split bytes=816
        Spilled Records=0
        Failed Shuffles=0
        Merged Map outputs=0
        GC time elapsed (ms)=1687
        CPU time spent (ms)=153920
        Physical memory (bytes) snapshot=775319552
        Virtual memory (bytes) snapshot=8299081728
        Total committed heap usage (bytes)=1178075136
    org.apache.hadoop.hbase.mapreduce.RowCounter$RowCounterMapper$Counters
        ROWS=10103174
    File Input Format Counters 
        Bytes Read=0
    File Output Format Counters 
        Bytes Written=0

二、加大count命令的CACHE

如下:

hbase(main):001:0> count 'testtable0728', INTERVAL => 100000,CACHE => 100000

结果,数据量大时依然较慢,不及RowCounter一半,RowCounter数一千万条数据三分钟

转载于:https://www.cnblogs.com/zhengchunhao/p/5715464.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值