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.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Class<? extends RegionSplitPolicy>
protected HRegion
The region configured for this split policy. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canSplit()
Returnstrue
if the specified region can be split.protected void
configureForRegion
(HRegion region) Upon construction, this method will be called with the region to be governed.static RegionSplitPolicy
Create the RegionSplitPolicy configured for the given table.protected byte[]
static Class<? extends RegionSplitPolicy>
getSplitPolicyClass
(TableDescriptor htd, org.apache.hadoop.conf.Configuration conf) protected abstract boolean
Returns true if the specified region should be split.protected boolean
skipStoreFileRangeCheck
(String familyName) InHRegionFileSystem#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.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Field Details
-
DEFAULT_SPLIT_POLICY_CLASS
-
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
-
RegionSplitPolicy
public RegionSplitPolicy()
-
-
Method Details
-
configureForRegion
Upon construction, this method will be called with the region to be governed. It will be called once and only once. -
shouldSplit
Returns true if the specified region should be split. -
canSplit
Returnstrue
if the specified region can be split. -
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
InHRegionFileSystem#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
-