@InterfaceAudience.Public public interface RegionInfo extends Comparable<RegionInfo>
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areAdjacent(RegionInfo regionA,
RegionInfo regionB)
Check whether two regions are adjacent; i.e.
|
default int |
compareTo(RegionInfo other) |
boolean |
containsRange(byte[] rangeStartKey,
byte[] rangeEndKey) |
boolean |
containsRow(byte[] row) |
static RegionInfo |
createMobRegionInfo(TableName tableName)
Creates a RegionInfo object for MOB data.
|
static byte[] |
createRegionName(TableName tableName,
byte[] startKey,
byte[] id,
boolean newFormat)
Make a region name of passed parameters.
|
static byte[] |
createRegionName(TableName tableName,
byte[] startKey,
byte[] id,
int replicaId,
boolean newFormat)
Make a region name of passed parameters.
|
static byte[] |
createRegionName(TableName tableName,
byte[] startKey,
long regionid,
boolean newFormat)
Make a region name of passed parameters.
|
static byte[] |
createRegionName(TableName tableName,
byte[] startKey,
long regionid,
int replicaId,
boolean newFormat)
Make a region name of passed parameters.
|
static byte[] |
createRegionName(TableName tableName,
byte[] startKey,
String id,
boolean newFormat)
Make a region name of passed parameters.
|
String |
getEncodedName() |
byte[] |
getEncodedNameAsBytes() |
byte[] |
getEndKey() |
long |
getRegionId() |
byte[] |
getRegionName() |
String |
getRegionNameAsString() |
int |
getReplicaId() |
String |
getShortNameToLog() |
static String |
getShortNameToLog(List<RegionInfo> ris) |
static String |
getShortNameToLog(RegionInfo... hris) |
byte[] |
getStartKey() |
static byte[] |
getStartKey(byte[] regionName)
Gets the start key from the specified region name.
|
TableName |
getTable() |
default boolean |
isAdjacent(RegionInfo other) |
default boolean |
isDegenerate() |
default boolean |
isFirst() |
default boolean |
isLast() |
boolean |
isMetaRegion() |
default boolean |
isNext(RegionInfo after) |
boolean |
isOffline()
Deprecated.
since 3.0.0 and will be removed in 4.0.0
|
default boolean |
isOverlap(RegionInfo other) |
boolean |
isSplit() |
boolean |
isSplitParent()
Deprecated.
since 3.0.0 and will be removed in 4.0.0, Use
isSplit() instead. |
static List<RegionInfo> |
parseDelimitedFrom(byte[] bytes,
int offset,
int length)
Parses all the RegionInfo instances from the passed in stream until EOF.
|
static RegionInfo |
parseFrom(DataInputStream in)
Parses an RegionInfo instance from the passed in stream.
|
static byte[][] |
parseRegionName(byte[] regionName)
Separate elements of a regionName.
|
static byte[][] |
parseRegionNameOrReturnNull(byte[] regionName)
Separate elements of a regionName.
|
static String |
prettyPrint(String encodedRegionName)
Use logging.
|
static byte[] |
toByteArray(RegionInfo ri) |
static byte[] |
toDelimitedByteArray(RegionInfo... infos)
Serializes given RegionInfo's as a byte array.
|
static byte[] |
toDelimitedByteArray(RegionInfo ri)
Use this instead of
toByteArray(RegionInfo) when writing to a stream and you want to use
the pb mergeDelimitedFrom (w/o the delimiter, pb reads to EOF which may not be what you want). |
String getShortNameToLog()
long getRegionId()
byte[] getRegionName()
getRegionNameAsString()String getRegionNameAsString()
String getEncodedName()
byte[] getEncodedNameAsBytes()
byte[] getStartKey()
byte[] getEndKey()
int getReplicaId()
boolean isSplit()
@Deprecated boolean isOffline()
@Deprecated boolean isSplitParent()
isSplit() instead.boolean isMetaRegion()
boolean containsRange(byte[] rangeStartKey, byte[] rangeEndKey)
IllegalArgumentException - if the range passed is invalid (ie. end < start)boolean containsRow(byte[] row)
static String getShortNameToLog(RegionInfo... hris)
hris
(usually encoded name) for us logging.static String getShortNameToLog(List<RegionInfo> ris)
hris (usually encoded name)
for us logging.static byte[] getStartKey(byte[] regionName) throws IOException
IOExceptionstatic boolean areAdjacent(RegionInfo regionA, RegionInfo regionB)
static byte[] toByteArray(RegionInfo ri)
parseFrom(byte[])static String prettyPrint(String encodedRegionName)
encodedRegionName - The encoded regionname.hbase:meta if passed 1028785192 else returns
encodedRegionNamestatic byte[] createRegionName(TableName tableName, byte[] startKey, long regionid, boolean newFormat)
startKey - Can be nullregionid - Region id (Usually timestamp from when region was created).newFormat - should we create the region name in the new format
(such that it contains its encoded name?).static byte[] createRegionName(TableName tableName, byte[] startKey, String id, boolean newFormat)
startKey - Can be nullid - Region id (Usually timestamp from when region was created).newFormat - should we create the region name in the new format
(such that it contains its encoded name?).static byte[] createRegionName(TableName tableName, byte[] startKey, long regionid, int replicaId, boolean newFormat)
startKey - Can be nullregionid - Region id (Usually timestamp from when region was created).newFormat - should we create the region name in the new format
(such that it contains its encoded name?).static byte[] createRegionName(TableName tableName, byte[] startKey, byte[] id, boolean newFormat)
startKey - Can be nullid - Region id (Usually timestamp from when region was created).newFormat - should we create the region name in the new format
(such that it contains its encoded name?).static byte[] createRegionName(TableName tableName, byte[] startKey, byte[] id, int replicaId, boolean newFormat)
startKey - Can be nullid - Region id (Usually timestamp from when region was created).newFormat - should we create the region name in the new formatstatic RegionInfo createMobRegionInfo(TableName tableName)
tableName - the name of the tableRegionInfo.static byte[][] parseRegionName(byte[] regionName) throws IOException
IOException - if not parseable as regionName.static byte[][] parseRegionNameOrReturnNull(byte[] regionName)
tablename,startkey,regionIdTimestamp[_replicaId][.encodedName.].
Startkey can contain the delimiter (',') so we parse from the start and then parse from
the end.static byte[] toDelimitedByteArray(RegionInfo... infos) throws IOException
toByteArray(RegionInfo) when
writing to a stream and you want to use the pb mergeDelimitedFrom (w/o the delimiter, pb reads
to EOF which may not be what you want). parseDelimitedFrom(byte[], int, int) can
be used to read back the instances.infos - RegionInfo objects to serializeIOExceptionstatic byte[] toDelimitedByteArray(RegionInfo ri) throws IOException
toByteArray(RegionInfo) when writing to a stream and you want to use
the pb mergeDelimitedFrom (w/o the delimiter, pb reads to EOF which may not be what you want).IOExceptionstatic RegionInfo parseFrom(DataInputStream in) throws IOException
toDelimitedByteArray(RegionInfo).IOExceptionstatic List<RegionInfo> parseDelimitedFrom(byte[] bytes, int offset, int length) throws IOException
bytes - serialized bytesoffset - the start offset into the byte[] bufferlength - how far we should read into the byte[] bufferIOExceptiondefault boolean isFirst()
default boolean isLast()
default boolean isNext(RegionInfo after)
isAdjacent(RegionInfo),
areAdjacent(RegionInfo, RegionInfo)default boolean isAdjacent(RegionInfo other)
isNext(RegionInfo)default boolean isDegenerate()
default boolean isOverlap(RegionInfo other)
isDegenerate()default int compareTo(RegionInfo other)
compareTo in interface Comparable<RegionInfo>Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.