org.apache.hadoop.hbase.regionserver
Class DelimitedKeyPrefixRegionSplitPolicy

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.hadoop.hbase.regionserver.RegionSplitPolicy
          extended by org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy
              extended by org.apache.hadoop.hbase.regionserver.IncreasingToUpperBoundRegionSplitPolicy
                  extended by org.apache.hadoop.hbase.regionserver.DelimitedKeyPrefixRegionSplitPolicy
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable

@InterfaceAudience.Private
public class DelimitedKeyPrefixRegionSplitPolicy
extends IncreasingToUpperBoundRegionSplitPolicy

A custom RegionSplitPolicy implementing a SplitPolicy that groups rows by a prefix of the row-key with a delimiter. Only the first delimiter for the row key will define the prefix of the row key that is used for grouping. This ensures that a region is not split "inside" a prefix of a row key. I.e. rows can be co-located in a region by their prefix. As an example, if you have row keys delimited with _, like userid_eventtype_eventid, and use prefix delimiter _, this split policy ensures that all rows starting with the same userid, belongs to the same region.

See Also:
KeyPrefixRegionSplitPolicy

Field Summary
static String DELIMITER_KEY
           
 
Fields inherited from class org.apache.hadoop.hbase.regionserver.RegionSplitPolicy
region
 
Constructor Summary
DelimitedKeyPrefixRegionSplitPolicy()
           
 
Method Summary
protected  void configureForRegion(HRegion region)
          Upon construction, this method will be called with the region to be governed.
protected  byte[] getSplitPoint()
           
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.IncreasingToUpperBoundRegionSplitPolicy
getSizeToCheck, shouldSplit
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.RegionSplitPolicy
create, getSplitPolicyClass, skipStoreFileRangeCheck, skipStoreFileRangeCheck
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER_KEY

public static final String DELIMITER_KEY
See Also:
Constant Field Values
Constructor Detail

DelimitedKeyPrefixRegionSplitPolicy

public DelimitedKeyPrefixRegionSplitPolicy()
Method Detail

configureForRegion

protected void configureForRegion(HRegion region)
Description copied from class: RegionSplitPolicy
Upon construction, this method will be called with the region to be governed. It will be called once and only once.

Overrides:
configureForRegion in class IncreasingToUpperBoundRegionSplitPolicy

getSplitPoint

protected byte[] getSplitPoint()
Overrides:
getSplitPoint in class RegionSplitPolicy
Returns:
the key at which the region should be split, or null if it cannot be split. This will only be called if shouldSplit previously returned true.


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.