Suppose, that you need to create an HBase table with a certain preliminary created number of regions. You can use RegionSplitter tool to do this.
Running RegionSplitter from command line / shell
An example of a call from the command line / shell:
$HBASE_HOME/bin/hbase org.apache.hadoop.hbase.util.RegionSplitter -c 10 -f cf your_namespace:your_table HexStringSplit
The pattern is:
RegionSplitter <OPTIONS> <TABLE> <SPLITALGORITHM>
SPLITALGORITHM
is a java class name of a class implementing SplitAlgorithm
, or one of the special strings HexStringSplit
or UniformSplit
, which are built-in split algorithms. HexStringSplit
treats keys as hexadecimal ASCII, and UniformSplit
treats keys as arbitrary bytes.
The main options are:
-c <region count> | Create a new table with a pre-split number of regions |
-D <property=value> | Override HBase Configuration Settings |
-f <family:family:…> | Column Families to create with new table. Required with -c |
-o <count> | Max outstanding splits that have unfinished major compaction |
-r | Perform a rolling split of an existing region |
If you still have any questions, feel free to ask me in the comments under this article, or write me on promark33@gmail.com.