Let's say your table has 10 region and their names are 1,2...10.
Hbase does not provide a direct merge 2-8 of these 7 region methods, if you want to merge multiple region, it is a little more trouble, the method is as follows
First, use the Merge_region method that comes with the hbase shell:
Merge the regions. Passing ' true ' as the optional third parameter would force
A merge (' force ' merges regardless else merge would fail unless passed
Adjacent regions. "Force" is a for-expert use only).
Note:you must pass the encoded region name, the
This command was a little different from and region operations. The encoded
Region name was the hash suffix on region names:e.g. If the region name were
testtable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396. Then
The encoded region name portion is 527db22f95c8a9e0116f0cc13c680396
Examples:
hbase> merge_region ' encoded_regionname ', ' encoded_regionname '
hbase> merge_region ' encoded_regionname ', ' encoded_regionname ', true
Merging multiple region with the Merge_region method will generate a new region, but there will be 2 issues
1:overlap (HBase metadata information not processed)
The region information on the 2:HDFS was not processed.
To resolve both issues, you can use the HBase hbck command, for example:
HBase hbck Ssp_rt-fixhdfsoverlaps-maxmerge 100-fixmeta-fixassignments
This command merges the region of overlap in hbase metadata and deletes the corresponding file on HDFs