Hbase region slice reqion slice merge operation

View HBase table partitioning

scan 'hbase:meta'

t1,,1487821235337.353a385f28af52ed47e675f18242bbf8.       column=info:regioninfo, timestamp=1487821236518, value={ENCODED => 353a385f28af52ed47e675f18242bbf8, NAME => 't1,,1487821235337.353a385f28af52ed47e675f18242bbf8.', START
                                                           KEY => '', ENDKEY => ''}
 t1,,1487821235337.353a385f28af52ed47e675f18242bbf8.       column=info:seqnumDuringOpen, timestamp=1488359119701, value=\x00\x00\x00\x00\x00\x00\x00\x14
 t1,,1487821235337.353a385f28af52ed47e675f18242bbf8.       column=info:server, timestamp=1488359119701, value=centos2:16020
 t1,,1487821235337.353a385f28af52ed47e675f18242bbf8.       column=info:serverstartcode, timestamp=1488359119701, value=1488359111761

full region name 

t1, 1487821235337.53a385f28af52ed47e675f18242bbf8. 

Tablespace: table name, start rowId, timestamp, hashcode(MD5)

 

region slice

grammar

    split 'tableName'

    split 'namespace:tableName'

    split 'regionName' # format: 'tableName,startKey,id'

    split 'tableName', 'splitKey'

    split 'regionName', 'splitKey'

 

Where 'splitKey' indicates which line to start splitting from

 

 

reqion slice merge

  hbase> merge_region 'ENCODED_REGIONNAME', 'ENCODED_REGIONNAME'

  hbase> merge_region 'ENCODED_REGIONNAME', 'ENCODED_REGIONNAME', true     //强制合并

Where 'ENCODED_REGIONNAME' represents the hashcode in the region Id, such as " 353a385f28af52ed47e675f18242bbf8 " in the case of this article

 

Note: Only regions adjacent to startkey and endkey can be merged, and non-adjacent regions can only be forced to merge

 

 

Hbase data query process :

1. The client first connects to zookeeper and looks up the location of the table hbase:meta.

2. Query the table hbase:meta, find a specific region according to the start key and end key of each region, and obtain the server where the region is located, such as " column=info:server, timestamp=1488359119701, value=centos2:16020 "

3. Go to the specified server to find the region.

4. The information in the hbase:meta table will be cached to facilitate the next lookup.

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326641838&siteId=291194637