@InterfaceAudience.Private public class DelimitedKeyPrefixRegionSplitRestriction extends RegionSplitRestriction
RegionSplitRestriction
implementation 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.
Modifier and Type | Field and Description |
---|---|
private byte[] |
delimiter |
static String |
DELIMITER_KEY |
private static org.slf4j.Logger |
LOG |
RESTRICTION_TYPE_DELIMITED_KEY_PREFIX, RESTRICTION_TYPE_KEY, RESTRICTION_TYPE_KEY_PREFIX, RESTRICTION_TYPE_NONE
Constructor and Description |
---|
DelimitedKeyPrefixRegionSplitRestriction() |
Modifier and Type | Method and Description |
---|---|
byte[] |
getRestrictedSplitPoint(byte[] splitPoint)
Returns a restricted split point.
|
void |
initialize(TableDescriptor tableDescriptor,
org.apache.hadoop.conf.Configuration conf)
Initialize the RegionSplitRestriction instance
|
create
private static final org.slf4j.Logger LOG
public static final String DELIMITER_KEY
private byte[] delimiter
public DelimitedKeyPrefixRegionSplitRestriction()
public void initialize(TableDescriptor tableDescriptor, org.apache.hadoop.conf.Configuration conf) throws IOException
RegionSplitRestriction
initialize
in class RegionSplitRestriction
tableDescriptor
- the table descriptorconf
- the configurationIOException
- if an error occurspublic byte[] getRestrictedSplitPoint(byte[] splitPoint)
RegionSplitRestriction
getRestrictedSplitPoint
in class RegionSplitRestriction
splitPoint
- the split point determined by RegionSplitPolicy
or specified by a
user manuallyCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.