HFile属性查看

 当生成完成一个HFile后,如果你不想因为出错而重做数据,建议在bulkimport之前,查看一下hfile
hbase提供了一个查看HFile属性的包 org.apache.hadoop.hbase.io.hfile.HFile
$hbase org.apache.hadoop.hbase.io.hfile.HFile
usage: HFile [-a] [-b] [-e] [-f <arg>] [-j] [-k] [-m] [-p] [-r <arg>] [-s
       <arg>] [-v]
 -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/.META./12/34
 -j,--json              Print in JSON format
 -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. '.META.,,1'
 -s,--seekToRow <arg>   Seek to this row and print all the kvs for this
                        row only
 -v,--verbose           Verbose output; emits file and meta data
                        delimiters
 
 例如使用-p打印kv,示例如下
hbase org.apache.hadoop.hbase.io.hfile.HFile -f /home/xxxxx/scan-xxxx-xxxx-xxxx-xxxx/attr/e8b8a5e0d19a4f7ca342d92d50371929  -p  
 
K: http://com.book108.www/search.asp/attr:uniq/1358155195054/Put/vlen=23 V: http://www.book108.com/
K: http://com.book108.www/search.asp?flag=11&flag2=?/attr:uniq/1358155195120/Put/vlen=48 V: http://www.book108.com/search.asp?flag=11&flag2=
K: http://com.book108.www/search.asp?flag=3&flag2=?/attr:uniq/1358155195121/Put/vlen=47 V: http://www.book108.com/search.asp?flag=3&flag2=
K: http://com.book108.www/search.asp?flag=4&flag2=%A7%B3?/attr:uniq/1358155195121/Put/vlen=53 V: http://www.book108.com/search.asp?flag=4&flag2=%A7%B3
K: http://com.book108.www/search.asp?flag=4&flag2=?/attr:uniq/1358155195121/Put/vlen=47 V:  http://www.book108.com/search.asp?flag=4&flag2=
 
选自HBase权威指南(HBase The Definitive Guide) P331
 

转载于:https://www.cnblogs.com/clj37573/archive/2013/01/14/2860175.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值