From 590c2b839f1b6e30bcc86f35ccafe3e37224f50a Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Mon, 22 Dec 2014 12:41:45 +1000 Subject: [PATCH] HBASE_12701 Document how to set the split policy on a given table --- src/main/docbkx/book.xml | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/src/main/docbkx/book.xml b/src/main/docbkx/book.xml index ee2d7fb..b4d1243 100644 --- a/src/main/docbkx/book.xml +++ b/src/main/docbkx/book.xml @@ -3325,15 +3325,37 @@ ctime = Sat Jun 23 11:13:40 PDT 2012 splits (and for why you might do this)
Custom Split Policies - The default split policy can be overwritten using a custom RegionSplitPolicy (HBase 0.94+). - Typically a custom split policy should extend HBase's default split policy: ConstantSizeRegionSplitPolicy. - - The policy can set globally through the HBaseConfiguration used or on a per table basis: - -HTableDescriptor myHtd = ...; -myHtd.setValue(HTableDescriptor.SPLIT_POLICY, MyCustomSplitPolicy.class.getName()); - - + You can override the default split policy using a custom RegionSplitPolicy (HBase 0.94+). Typically a custom split policy should extend + HBase's default split policy: ConstantSizeRegionSplitPolicy. + The policy can set globally through the HBase configuration or on a per-table + basis. + + Configuring the Split Policy Globally in <filename>hbase-site.xml</filename> + + hbase.regionserver.region.split.policy + org.apache.hadoop.hbase.regionserver.IncreasingToUpperBoundRegionSplitPolicy + ]]> + + + + Configuring a Split Policy On a Table Using the Java API + +HTableDescriptor tableDesc = new HTableDescriptor("test"); +tableDesc.setValue(HTableDescriptor.SPLIT_POLICY, ConstantSizeRegionSplitPolicy.class.getName()); +tableDesc.addFamily(new HColumnDescriptor(Bytes.toBytes("cf1"))); +admin.createTable(tableDesc); + + + + 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'} +
-- 2.2.1