Configuring auto split policy in an HBase table

Know how to configure automatic split policy in an HBase table.

When a region in an HBase table reaches a certain limit, HBase automatically divides it into two regions. This is the HBase default split policy. However, you can override the default split policy and configure a custom split policy for the regions in an HBase table.

Using the Cloudera Manager, you can configure the default split policy at the system level or the table level using the HBase shell.

In this topic, let us consider an example of configuring the split policy for regions in an HBase table by setting the hbase.regionserver.region.split.policy parameter.

Ensure that you have administrator privileges in the CDP environment.

  1. Log in to the Cloudera Manager as an administrator.
  2. Select the HBase service.
  3. Go to Configuration > Category > Advanced > HBase Service Advanced Configuration Snippet (Safety Valve) for hbase-site.xml.
  4. Configure the split policy that you need.
    For example, to set the split policy for the regions in an HBase table set the value of hbase.regionserver.region.split.policy as org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy.

    For more information on custom policies, see HBase custom split policies.

  5. Click Save Changes.
  6. Restart the HBase service.
    Alternatively, you can use the HBase shell to set the split policy for the regions at the table level.
    1. Log in to the HBase shell.
    2. Use the ALTER command to set the value to org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy.

      The following is a sample command.

      $ hbase shell
      $ hbase > alter '<TABLE_NAME>', {METADATA => {'SPLIT_POLICY' => 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy'}}