HBase Region Split

- Split Policy (ConstantSizeRegionSplitPolicy, IncreasingToUpperBoundRegionSplitPolicy(default), KeyPrefixRegionSplitPolicy)

- Split Point, The first row of center block of the biggest file of the store

- Split Workflow (prepare -> execute -> (rollback)), try to be transactional

  • prepare (create two sub regions in memory, like tablename, regionname, startkey and endkey)
  • execute



  1. change region status to 'SPLITTING' in zookeeper /region-in-transaction (RIT)
  2. master gets notification of region status change and change its status in memory
  3. create temp folder .split under parent region.
  4. close parent region and flush its data to disk.
  5. create sub folders for the two sub regions and create reference files (name comprising of hfile+region, content: split point + true/false) for them 
  6. copy the sub folders to HBase folder
  7. notify offline of parent region to META table and add two sub regions to the table (the data of parent region is kept until no reference to it. it's major compactions of sub regions removing the reference. Master checks parent regions in splitting and remove it if there is no reference to it)
  8. the new two regions are in the same region server since they need to reference the data of the parent region.

  • rollback (in version 2.0, use HLog to record transaction thus almost no RIT)

- show region info

scan 'hbase:meta',{FILTER=>"PrefixFilter('table_name')"}

references: http://hbasefly.com/2017/08/27/hbase-split/, https://zh.hortonworks.com/blog/apache-hbase-region-splitting-and-merging/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值