diff --git a/src/main/asciidoc/_chapters/architecture.adoc b/src/main/asciidoc/_chapters/architecture.adoc index cd9a4a971bb..1833cfc7ac3 100644 --- a/src/main/asciidoc/_chapters/architecture.adoc +++ b/src/main/asciidoc/_chapters/architecture.adoc @@ -1331,6 +1331,35 @@ The RegionServer splits a region, offlines the split region and then adds the da See <> for how to manually manage splits (and for why you might do this). ==== Custom Split Policies +ou can override the default split policy using a custom link:http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.html[RegionSplitPolicy](HBase 0.94+). Typically a custom split policy should extend +HBase's default split policy: link:http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.html[IncreasingToUpperBoundRegionSplitPolicy]. + +The policy can set globally through the HBase configuration or on a per-table +basis. + +.Configuring the Split Policy Globally in _hbase-site.xml_ +[source,xml] +---- + + hbase.regionserver.region.split.policy + org.apache.hadoop.hbase.regionserver.IncreasingToUpperBoundRegionSplitPolicy + +---- + +.Configuring a Split Policy On a Table Using the Java API +[source,java] +HTableDescriptor tableDesc = new HTableDescriptor("test"); +tableDesc.setValue(HTableDescriptor.SPLIT_POLICY, ConstantSizeRegionSplitPolicy.class.getName()); +tableDesc.addFamily(new HColumnDescriptor(Bytes.toBytes("cf1"))); +admin.createTable(tableDesc); +---- + +[source] +.Configuring the Split Policy On a Table Using HBase Shell +---- +hbase> create 'test', {METHOD => 'table_att', CONFIG => {'SPLIT_POLICY' => 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy'}}, +{NAME => 'cf1'} +---- The default split policy can be overwritten using a custom link:http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/RegionSplitPolicy.html[RegionSplitPolicy(HBase 0.94+)]. Typically a custom split policy should extend HBase's default split policy: link:http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.html[ConstantSizeRegionSplitPolicy].