Package org.apache.hadoop.hbase.client
Class MutableRegionInfo
java.lang.Object
org.apache.hadoop.hbase.client.MutableRegionInfo
- All Implemented Interfaces:
Comparable<RegionInfo>,RegionInfo
An implementation of RegionInfo that adds mutable methods so can build a RegionInfo instance.
Package private. Use
RegionInfoBuilder creating instances of RegionInfos.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final byte[]private final byte[]private final intprivate static final org.slf4j.Loggerprivate static final intprivate booleanThe new format for a region name contains its encodedName at the end.private final longprivate final byte[]private final intprivate booleanprivate final byte[]private final TableNameFields inherited from interface org.apache.hadoop.hbase.client.RegionInfo
COMPARATOR, DEFAULT_REPLICA_ID, ENC_SEPARATOR, INVALID_REGION_NAME_FORMAT_MESSAGE, MD5_HEX_LENGTH, REPLICA_ID_DELIMITER, REPLICA_ID_FORMAT -
Constructor Summary
ConstructorsConstructorDescriptionMutableRegionInfo(long regionId, TableName tableName, int replicaId) Package private constructor used constructing MutableRegionInfo for the first meta regionsMutableRegionInfo(TableName tableName, byte[] startKey, byte[] endKey, boolean split, long regionId, int replicaId, boolean offLine) -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]checkEndKey(byte[] endKey) private static intcheckReplicaId(int regionId) private static byte[]checkStartKey(byte[] startKey) private static TableNamecheckTableName(TableName tableName) booleancontainsRange(byte[] rangeStartKey, byte[] rangeEndKey) Returns true if the given inclusive range of rows is fully contained by this region.booleancontainsRow(byte[] row) Return true if the given row falls in this region.booleanprivate static intgenerateHashCode(TableName tableName, byte[] startKey, byte[] endKey, long regionId, int replicaId, boolean offLine, byte[] regionName) Returns the encoded region namebyte[]Returns the encoded region name as an array of bytes.byte[]Returns the endKeylongReturns the regionIdbyte[]Returns the regionName as an array of bytes.Returns Region name as a String for use in logging, etc.intReturns the region replica idReturns Return a short, printable name for this region (usually encoded name) for us logging.byte[]Returns the startKeygetTable()Get current table name of the regioninthashCode()booleanReturns true if this region is a meta regionbooleanDeprecated.since 3.0.0 and will be removed in 4.0.0booleanisSplit()Returns True if has been split and has daughters.booleanDeprecated.since 3.0.0 and will be removed in 4.0.0, UseisSplit()instead.setOffline(boolean offLine) The parent of a region split is offline while split daughters hold references to the parent.setSplit(boolean split) Change the split status flag.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.client.RegionInfo
compareTo, isAdjacent, isDegenerate, isFirst, isLast, isNext, isOverlap
-
Field Details
-
LOG
-
MAX_REPLICA_ID
- See Also:
-
offLine
The new format for a region name contains its encodedName at the end. The encoded name also serves as the directory name for the region in the filesystem. New region name format: <tablename>,,<startkey>,<regionIdTimestamp>.<encodedName>. where, <encodedName> is a hex version of the MD5 hash of <tablename>,<startkey>,<regionIdTimestamp> The old region name format: <tablename>,<startkey>,<regionIdTimestamp> For region names in the old format, the encoded name is a 32-bit JenkinsHash integer value (in its decimal notation, string form).**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.
-
split
-
regionId
-
replicaId
-
regionName
-
startKey
-
endKey
-
hashCode
-
encodedName
-
encodedNameAsBytes
-
tableName
-
-
Constructor Details
-
MutableRegionInfo
MutableRegionInfo(long regionId, TableName tableName, int replicaId) Package private constructor used constructing MutableRegionInfo for the first meta regions -
MutableRegionInfo
MutableRegionInfo(TableName tableName, byte[] startKey, byte[] endKey, boolean split, long regionId, int replicaId, boolean offLine)
-
-
Method Details
-
generateHashCode
private static int generateHashCode(TableName tableName, byte[] startKey, byte[] endKey, long regionId, int replicaId, boolean offLine, byte[] regionName) -
checkStartKey
-
checkEndKey
-
checkTableName
-
checkReplicaId
-
getShortNameToLog
Returns Return a short, printable name for this region (usually encoded name) for us logging.- Specified by:
getShortNameToLogin interfaceRegionInfo
-
getRegionId
Returns the regionId- Specified by:
getRegionIdin interfaceRegionInfo
-
getRegionName
Description copied from interface:RegionInfoReturns the regionName as an array of bytes.- Specified by:
getRegionNamein interfaceRegionInfo- Returns:
- the regionName as an array of bytes.
- See Also:
-
getRegionNameAsString
Returns Region name as a String for use in logging, etc.- Specified by:
getRegionNameAsStringin interfaceRegionInfo
-
getEncodedName
Returns the encoded region name- Specified by:
getEncodedNamein interfaceRegionInfo
-
getEncodedNameAsBytes
Description copied from interface:RegionInfoReturns the encoded region name as an array of bytes.- Specified by:
getEncodedNameAsBytesin interfaceRegionInfo
-
getStartKey
Returns the startKey- Specified by:
getStartKeyin interfaceRegionInfo
-
getEndKey
Returns the endKey- Specified by:
getEndKeyin interfaceRegionInfo
-
getTable
Get current table name of the region- Specified by:
getTablein interfaceRegionInfo
-
containsRange
Returns true if the given inclusive range of rows is fully contained by this region. For example, if the region is foo,a,g and this is passed ["b","c"] or ["a","c"] it will return true, but if this is passed ["b","z"] it will return false.- Specified by:
containsRangein interfaceRegionInfo- Throws:
IllegalArgumentException- if the range passed is invalid (ie. end < start)
-
containsRow
Return true if the given row falls in this region.- Specified by:
containsRowin interfaceRegionInfo
-
isMetaRegion
Returns true if this region is a meta region- Specified by:
isMetaRegionin interfaceRegionInfo
-
isSplit
Returns True if has been split and has daughters.- Specified by:
isSplitin interfaceRegionInfo
-
setSplit
Change the split status flag.- Parameters:
split- set split status
-
isOffline
Deprecated.since 3.0.0 and will be removed in 4.0.0Description copied from interface:RegionInfoReturns True if this region is offline.- Specified by:
isOfflinein interfaceRegionInfo- Returns:
- True if this region is offline.
- See Also:
-
setOffline
The parent of a region split is offline while split daughters hold references to the parent. Offlined regions are closed.- Parameters:
offLine- Set online/offline status.
-
isSplitParent
Deprecated.since 3.0.0 and will be removed in 4.0.0, UseisSplit()instead.Description copied from interface:RegionInfoReturns True if this is a split parent region.- Specified by:
isSplitParentin interfaceRegionInfo- Returns:
- True if this is a split parent region.
- See Also:
-
getReplicaId
Returns the region replica id- Specified by:
getReplicaIdin interfaceRegionInfo- Returns:
- returns region replica id
-
toString
-
equals
-
hashCode
-