@InterfaceAudience.Private class MutableRegionInfo extends Object implements RegionInfo
RegionInfoBuilder
creating instances of RegionInfo
s.Modifier and Type | Field and Description |
---|---|
private String |
encodedName |
private byte[] |
encodedNameAsBytes |
private byte[] |
endKey |
private int |
hashCode |
private static org.slf4j.Logger |
LOG |
private static int |
MAX_REPLICA_ID |
private boolean |
offLine
The new format for a region name contains its encodedName at the end.
|
private long |
regionId |
private byte[] |
regionName |
private int |
replicaId |
private boolean |
split |
private byte[] |
startKey |
private TableName |
tableName |
COMPARATOR, DEFAULT_REPLICA_ID, ENC_SEPARATOR, INVALID_REGION_NAME_FORMAT_MESSAGE, MD5_HEX_LENGTH, REPLICA_ID_DELIMITER, REPLICA_ID_FORMAT, UNDEFINED
Constructor and Description |
---|
MutableRegionInfo(long regionId,
TableName tableName,
int replicaId)
Package private constructor used constructing MutableRegionInfo for the first meta regions
|
MutableRegionInfo(TableName tableName,
byte[] startKey,
byte[] endKey,
boolean split,
long regionId,
int replicaId,
boolean offLine) |
Modifier and Type | Method and Description |
---|---|
private static byte[] |
checkEndKey(byte[] endKey) |
private static int |
checkReplicaId(int regionId) |
private static byte[] |
checkStartKey(byte[] startKey) |
private static TableName |
checkTableName(TableName tableName) |
boolean |
containsRange(byte[] rangeStartKey,
byte[] rangeEndKey)
Returns true if the given inclusive range of rows is fully contained by this region.
|
boolean |
containsRow(byte[] row)
Return true if the given row falls in this region.
|
boolean |
equals(Object o) |
private static int |
generateHashCode(TableName tableName,
byte[] startKey,
byte[] endKey,
long regionId,
int replicaId,
boolean offLine,
byte[] regionName) |
String |
getEncodedName()
Returns the encoded region name
|
byte[] |
getEncodedNameAsBytes()
Returns the encoded region name as an array of bytes.
|
byte[] |
getEndKey()
Returns the endKey
|
long |
getRegionId()
Returns the regionId
|
byte[] |
getRegionName()
Returns the regionName as an array of bytes.
|
String |
getRegionNameAsString()
Returns Region name as a String for use in logging, etc.
|
int |
getReplicaId()
Returns the region replica id
|
String |
getShortNameToLog()
Returns Return a short, printable name for this region (usually encoded name) for us logging.
|
byte[] |
getStartKey()
Returns the startKey
|
TableName |
getTable()
Get current table name of the region n
|
int |
hashCode() |
boolean |
isMetaRegion()
Returns true if this region is a meta region
|
boolean |
isOffline()
Deprecated.
since 3.0.0 and will be removed in 4.0.0
|
boolean |
isSplit()
Returns True if has been split and has daughters.
|
boolean |
isSplitParent()
Deprecated.
since 3.0.0 and will be removed in 4.0.0, Use
isSplit() instead. |
MutableRegionInfo |
setOffline(boolean offLine)
The parent of a region split is offline while split daughters hold references to the parent.
|
MutableRegionInfo |
setSplit(boolean split)
Change the split status flag.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
areAdjacent, compareTo, createMobRegionInfo, createRegionName, createRegionName, createRegionName, createRegionName, createRegionName, encodeRegionName, getRegionNameAsString, getRegionNameAsString, getShortNameToLog, getShortNameToLog, getStartKey, getTable, hasEncodedName, isAdjacent, isDegenerate, isEncodedRegionName, isFirst, isLast, isMD5Hash, isNext, isOverlap, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFromOrNull, parseFromOrNull, parseRegionName, parseRegionNameOrReturnNull, prettyPrint, toByteArray, toDelimitedByteArray, toDelimitedByteArray
private static final org.slf4j.Logger LOG
private static final int MAX_REPLICA_ID
private boolean offLine
**NOTE** The first hbase:meta region, and regions created by an older version of HBase (0.20 or prior) will continue to use the old region name format.
private boolean split
private final long regionId
private final int replicaId
private final byte[] regionName
private final byte[] startKey
private final byte[] endKey
private final int hashCode
private final String encodedName
private final byte[] encodedNameAsBytes
MutableRegionInfo(long regionId, TableName tableName, int replicaId)
MutableRegionInfo(TableName tableName, byte[] startKey, byte[] endKey, boolean split, long regionId, int replicaId, boolean offLine)
private static int generateHashCode(TableName tableName, byte[] startKey, byte[] endKey, long regionId, int replicaId, boolean offLine, byte[] regionName)
private static byte[] checkStartKey(byte[] startKey)
private static byte[] checkEndKey(byte[] endKey)
private static TableName checkTableName(TableName tableName)
private static int checkReplicaId(int regionId)
public String getShortNameToLog()
getShortNameToLog
in interface RegionInfo
public long getRegionId()
getRegionId
in interface RegionInfo
public byte[] getRegionName()
RegionInfo
getRegionName
in interface RegionInfo
getRegionNameAsString()
public String getRegionNameAsString()
getRegionNameAsString
in interface RegionInfo
public String getEncodedName()
getEncodedName
in interface RegionInfo
public byte[] getEncodedNameAsBytes()
RegionInfo
getEncodedNameAsBytes
in interface RegionInfo
public byte[] getStartKey()
getStartKey
in interface RegionInfo
public byte[] getEndKey()
getEndKey
in interface RegionInfo
public TableName getTable()
getTable
in interface RegionInfo
public boolean containsRange(byte[] rangeStartKey, byte[] rangeEndKey)
containsRange
in interface RegionInfo
IllegalArgumentException
- if the range passed is invalid (ie. end < start)public boolean containsRow(byte[] row)
containsRow
in interface RegionInfo
public boolean isMetaRegion()
isMetaRegion
in interface RegionInfo
public boolean isSplit()
isSplit
in interface RegionInfo
public MutableRegionInfo setSplit(boolean split)
split
- set split status n@Deprecated public boolean isOffline()
RegionInfo
isOffline
in interface RegionInfo
public MutableRegionInfo setOffline(boolean offLine)
offLine
- Set online/offline status. n@Deprecated public boolean isSplitParent()
isSplit()
instead.RegionInfo
isSplitParent
in interface RegionInfo
public int getReplicaId()
getReplicaId
in interface RegionInfo
public String toString()
toString
in class Object
Object.toString()
public boolean equals(Object o)
equals
in class Object
Object.equals(Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.