HBase 查看HFile内容

HBase 查看HFile内容

 

hbase 查看HFile hbase的数据文件最终存放的是HFile文件,即对MFile存储格式的封装修改,存储的为二进制格式内容,目前hbase提供的hbase org.apache.hadoop.hbase.io.hfile.HFile 工具类可以查看HFile文件内容,对排查region的分布情况有很大用途,以下为查询步骤:

  • 定位HFile文件
[hadoop@rm ~]$ hadoop fs -ls /hbase/data/default/TEST/b91a1994accb6e4fc2515aadd74dfc7b/0
15/03/26 17:47:01 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
-rw-r--r--   3 hadoop supergroup     327313 2015-03-20 22:18 /hbase/data/default/TEST/b91a1994accb6e4fc2515aadd74dfc7b/0/8413bc9aa70342f0a86a7ca7d70568a9
  • HFile查看8413bc9aa70342f0a86a7ca7d70568a9 文件
hbase hbase org.apache.hadoop.hbase.io.hfile.HFile -f /hbase/data/default/TEST/b91a1994accb6e4fc2515aadd74dfc7b/0/8413bc9aa70342f0a86a7ca7d70568a9 -p
  • 回车即可
  • 更多hbase org.apache.hadoop.hbase.io.hfile.HFile 的参数 可以
[hadoop@rm ~]$ /oneapm/local/hbase-0.98.10.1-hadoop2/bin/hbase org.apache.hadoop.hbase.io.hfile.HFile 
2015-03-26 17:52:45,338 INFO  [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
2015-03-26 17:52:45,485 INFO  [main] util.ChecksumType: Checksum using org.apache.hadoop.util.PureJavaCrc32
2015-03-26 17:52:45,486 INFO  [main] util.ChecksumType: Checksum can use org.apache.hadoop.util.PureJavaCrc32C
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/oneapm/local/hbase-0.98.10.1-hadoop2/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/oneapm/local/hadoop-2.5.2/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2015-03-26 17:52:45,757 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2015-03-26 17:52:46,329 INFO  [main] Configuration.deprecation: fs.default.name is deprecated. Instead, use fs.defaultFS
usage: HFile [-a] [-b] [-e] [-f <arg> | -r <arg>] [-h] [-k] [-m] [-p]
       [-s] [-v] [-w <arg>]
 -a,--checkfamily         Enable family check
 -b,--printblocks         Print block index meta data
 -e,--printkey            Print keys
 -f,--file <arg>          File to scan. Pass full-path; e.g.
                          hdfs://a:9000/hbase/hbase:meta/12/34
 -h,--printblockheaders   Print block headers for each block.
 -k,--checkrow            Enable row order check; looks for out-of-order
                          keys
 -m,--printmeta           Print meta data of file
 -p,--printkv             Print key/value pairs
 -r,--region <arg>        Region to scan. Pass region name; e.g.
                          'hbase:meta,,1'
 -s,--stats               Print statistics
 -v,--verbose             Verbose output; emits file and meta data
                          delimiters
 -w,--seekToRow <arg>     Seek to this row and print all the kvs for this
                          row only
[hadoop@rm ~]$ 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值