数据准备
# hbase shell窗口插入数据
hbase(main):015:0> put 'rrw_ugrp', 'rk002', 'user_attri:name', 'xiaoming002'
Took 0.0112 seconds
hbase(main):016:0> put 'rrw_ugrp', 'rk002', 'user_attri:age', 28
Took 0.0121 seconds
hbase(main):017:0> put 'rrw_ugrp', 'rk002', 'user_attri:sex', 'male'
Took 0.0092 seconds
# 查看刚才插入的数据
hbase(main):020:0> get 'rrw_ugrp', 'rk002'
COLUMN CELL
user_attri:age timestamp=1595398676217, value=28
user_attri:name timestamp=1595398663038, value=xiaoming002
user_attri:sex timestamp=1595398687205, value=male
1 row(s)
# 将刚才的数据刷写成hfile
hbase(main):021:0> flush 'rrw_ugrp'
Took 0.2071 seconds
查看hfile的hdfs路径
hbase命令查看hfile
查看命令帮助
[bigdataservice@hadoop008 ~]$ hbase hfile
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
usage: HFile [-a] [-b] [-e] [-f <arg> | -r <arg>] [-h] [-i] [-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.
-i,--checkMobIntegrity Print all cells whose mob files are missing
-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
命令用法
# 此命令不是在hbase shell窗口执行,而是在linux命令窗口
hbase file -e -m -p -f <hdfs_hfile_path>
执行hbase hfile命令
[bigdataservice@hadoop008 ~]$ hbase hfile -e -m -p -f /hbase/data/default/rrw_ugrp/d4e7c38ed6516f903a0815695f014d26/user_attri/39d6c7676561430da0a94c506072792b
结果显示