Class RegionSplitPolicy

java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.regionserver.RegionSplitPolicy
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
ConstantSizeRegionSplitPolicy, DisabledRegionSplitPolicy

@LimitedPrivate("Configuration") public abstract class RegionSplitPolicy extends org.apache.hadoop.conf.Configured
A split policy determines when a Region should be split.
See Also:
  • Field Details

    • DEFAULT_SPLIT_POLICY_CLASS

      private static final Class<? extends RegionSplitPolicy> DEFAULT_SPLIT_POLICY_CLASS
    • region

      protected HRegion region
      The region configured for this split policy. As of hbase-2.0.0, RegionSplitPolicy can be instantiated on the Master-side so the Phoenix local-indexer can block default hbase behavior. This is an exotic usage. Should not trouble any other users of RegionSplitPolicy.
  • Constructor Details

  • Method Details

    • configureForRegion

      protected void configureForRegion(HRegion region)
      Upon construction, this method will be called with the region to be governed. It will be called once and only once.
    • shouldSplit

      protected abstract boolean shouldSplit()
      Returns true if the specified region should be split.
    • canSplit

      protected boolean canSplit()
      Returns true if the specified region can be split.
    • getSplitPoint

      protected byte[] getSplitPoint()
      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.
    • create

      public static RegionSplitPolicy create(HRegion region, org.apache.hadoop.conf.Configuration conf) throws IOException
      Create the RegionSplitPolicy configured for the given table.
      Returns:
      a RegionSplitPolicy
      Throws:
      IOException
    • getSplitPolicyClass

      public static Class<? extends RegionSplitPolicy> getSplitPolicyClass(TableDescriptor htd, org.apache.hadoop.conf.Configuration conf) throws IOException
      Throws:
      IOException
    • skipStoreFileRangeCheck

      protected boolean skipStoreFileRangeCheck(String familyName)
      In HRegionFileSystem.splitStoreFile(org.apache.hadoop.hbase.client.RegionInfo, String, HStoreFile, byte[], boolean, RegionSplitPolicy) we are not creating the split reference if split row does not lie inside the StoreFile range. But in some use cases we may need to create the split reference even when the split row does not lie inside the StoreFile range. This method can be used to decide, whether to skip the the StoreFile range check or not.

      This method is not for general use. It is a mechanism put in place by Phoenix local indexing to defeat standard hbase behaviors. Phoenix local indices are very likely the only folks who would make use of this method. On the Master-side, we will instantiate a RegionSplitPolicy instance and run this method ONLY... none of the others make sense on the Master-side.

      TODO: Shutdown this phoenix specialization or do it via some other means.
      Returns:
      whether to skip the StoreFile range check or not