hbase-15-如何查看HFile

命令

➜  bin ./hbase hfile
2021-07-26 18:03:56,810 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
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

HFile内容

➜  bin ./hbase hfile -v -p -m -f /usr/local/var/hbase/data/default/Student/273cf57cdb948f3dd21144515aa886e7/Grades/07a96c6e8bd74d35b61ac6b76c883950
2021-07-26 18:06:46,345 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Scanning -> /usr/local/var/hbase/data/default/Student/273cf57cdb948f3dd21144515aa886e7/Grades/07a96c6e8bd74d35b61ac6b76c883950
2021-07-26 18:06:46,802 INFO  [main] metrics.MetricRegistries: Loaded MetricRegistries class org.apache.hadoop.hbase.metrics.impl.MetricRegistriesImpl
K: 0001/Grades:BigData/1626697899473/Put/vlen=2/seqid=8 V: 80
K: 0001/Grades:Computer/1626697899491/Put/vlen=2/seqid=9 V: 90
K: 0001/Grades:Math/1626697901910/Put/vlen=2/seqid=10 V: 85
Block index size as per heapsize: 328
reader=/usr/local/var/hbase/data/default/Student/273cf57cdb948f3dd21144515aa886e7/Grades/07a96c6e8bd74d35b61ac6b76c883950,
    compression=none,
    cacheConf=cacheDataOnRead=false,
    cacheDataOnWrite=false,
    cacheIndexesOnWrite=false,
    cacheBloomsOnWrite=false,
    cacheEvictOnClose=false,
    cacheDataCompressed=false,
    prefetchOnOpen=false,
    firstKey=Optional[0001/Grades:BigData/1626697899473/Put/seqid=0],
    lastKey=Optional[0001/Grades:Math/1626697901910/Put/seqid=0],
    avgKeyLen=28,
    avgValueLen=2,
    entries=3,
    length=4967
Trailer:
    fileinfoOffset=310,
    loadOnOpenDataOffset=194,
    dataIndexCount=1,
    metaIndexCount=0,
    totalUncomressedBytes=4868,
    entryCount=3,
    compressionCodec=NONE,
    uncompressedDataIndexSize=42,
    numDataIndexLevels=1,
    firstDataBlockOffset=0,
    lastDataBlockOffset=0,
    comparatorClassName=org.apache.hadoop.hbase.CellComparatorImpl,
    encryptionKey=NONE,
    majorVersion=3,
    minorVersion=3
Fileinfo:
    BLOOM_FILTER_TYPE = ROW
    COMPACTION_EVENT_KEY = PBUF
    DELETE_FAMILY_COUNT = 0
    EARLIEST_PUT_TS = 1626697899473
    KEY_VALUE_VERSION = 1
    LAST_BLOOM_KEY = 0001
    MAJOR_COMPACTION_KEY = false
    MAX_MEMSTORE_TS_KEY = 10
    MAX_SEQ_ID_KEY = 12
    TIMERANGE = 1626697899473....1626697901910
    hfile.AVG_KEY_LEN = 28
    hfile.AVG_VALUE_LEN = 2
    hfile.CREATE_TIME_TS = 1626701695215
    hfile.LASTKEY = 0001/Grades:Math/1626697901910/Put/vlen=0/mvcc=0
Mid-key: Optional[0001/Grades:BigData/1626697899473/Put/seqid=0]
Bloom filter:
    BloomSize: 2
    No of Keys in bloom: 1
    Max Keys for bloom: 1
    Percentage filled: 100%
    Number of chunks: 1
    Comparator: ByteArrayComparator
Delete Family Bloom filter:
    Not present
Scanned kv count -> 3

该HFile中包含3条数据

posted @ 2021-07-26 18:16  sixinshuier  阅读(76)  评论(0编辑  收藏  举报