@InterfaceAudience.Public
public interface RegionInfo
Modifier and Type | Field and Description |
---|---|
static Comparator<RegionInfo> |
COMPARATOR |
static int |
DEFAULT_REPLICA_ID |
static int |
ENC_SEPARATOR
Separator used to demarcate the encodedName in a region name
in the new format.
|
static String |
INVALID_REGION_NAME_FORMAT_MESSAGE |
static int |
MD5_HEX_LENGTH |
static byte |
REPLICA_ID_DELIMITER |
static String |
REPLICA_ID_FORMAT
to keep appended int's sorted in string format.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
areAdjacent(RegionInfo regionA,
RegionInfo regionB)
Check whether two regions are adjacent
|
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.
|
static String |
encodeRegionName(byte[] regionName) |
String |
getEncodedName() |
byte[] |
getEncodedNameAsBytes() |
byte[] |
getEndKey() |
long |
getRegionId() |
byte[] |
getRegionName() |
String |
getRegionNameAsString() |
static String |
getRegionNameAsString(byte[] regionName) |
static String |
getRegionNameAsString(RegionInfo ri,
byte[] regionName) |
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() |
static TableName |
getTable(byte[] regionName)
Gets the table name from the specified region name.
|
static boolean |
hasEncodedName(byte[] regionName)
Does region name contain its encoded name?
|
static boolean |
isEncodedRegionName(byte[] regionName) |
boolean |
isMetaRegion() |
boolean |
isOffline() |
boolean |
isSplit() |
boolean |
isSplitParent() |
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(byte[] bytes) |
static RegionInfo |
parseFrom(byte[] bytes,
int offset,
int len) |
static RegionInfo |
parseFrom(DataInputStream in)
Parses an RegionInfo instance from the passed in stream.
|
static RegionInfo |
parseFromOrNull(byte[] bytes) |
static RegionInfo |
parseFromOrNull(byte[] bytes,
int offset,
int len) |
static byte[][] |
parseRegionName(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). |
@InterfaceAudience.Private static final int ENC_SEPARATOR
@InterfaceAudience.Private static final int MD5_HEX_LENGTH
@InterfaceAudience.Private static final int DEFAULT_REPLICA_ID
@InterfaceAudience.Private static final String REPLICA_ID_FORMAT
@InterfaceAudience.Private static final byte REPLICA_ID_DELIMITER
@InterfaceAudience.Private static final String INVALID_REGION_NAME_FORMAT_MESSAGE
@InterfaceAudience.Private static final Comparator<RegionInfo> COMPARATOR
String getShortNameToLog()
long getRegionId()
byte[] getRegionName()
getRegionNameAsString()
String getRegionNameAsString()
String getEncodedName()
byte[] getEncodedNameAsBytes()
byte[] getStartKey()
byte[] getEndKey()
TableName getTable()
int getReplicaId()
boolean isSplit()
boolean isOffline()
boolean isSplitParent()
boolean isMetaRegion()
boolean containsRange(byte[] rangeStartKey, byte[] rangeEndKey)
rangeStartKey
- rangeEndKey
- IllegalArgumentException
- if the range passed is invalid (ie. end < start)boolean containsRow(byte[] row)
row
- @InterfaceAudience.Private static boolean hasEncodedName(byte[] regionName)
regionName
- region name@InterfaceAudience.Private static String encodeRegionName(byte[] regionName)
@InterfaceAudience.Private static String getRegionNameAsString(byte[] regionName)
@InterfaceAudience.Private static String getRegionNameAsString(@CheckForNull RegionInfo ri, byte[] regionName)
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.@InterfaceAudience.Private static TableName getTable(byte[] regionName)
regionName
- to extract the table name fromstatic byte[] getStartKey(byte[] regionName) throws IOException
regionName
- IOException
@InterfaceAudience.Private static boolean isEncodedRegionName(byte[] regionName) throws IOException
IOException
@InterfaceAudience.Private static RegionInfo parseFromOrNull(byte[] bytes)
bytes
- RegionInfo
or null if we failed deserialize or passed bytes null@InterfaceAudience.Private static RegionInfo parseFromOrNull(byte[] bytes, int offset, int len)
bytes
- offset
- len
- RegionInfo
or null
if we failed deserialize or passed bytes null@InterfaceAudience.Private static RegionInfo parseFrom(byte[] bytes) throws DeserializationException
bytes
- A pb RegionInfo serialized with a pb magic prefix.RegionInfo
DeserializationException
@InterfaceAudience.Private static RegionInfo parseFrom(byte[] bytes, int offset, int len) throws DeserializationException
bytes
- A pb RegionInfo serialized with a pb magic prefix.offset
- starting point in the byte arraylen
- length to read on the byte arrayRegionInfo
DeserializationException
static boolean areAdjacent(RegionInfo regionA, RegionInfo regionB)
regionA
- regionB
- static byte[] toByteArray(RegionInfo ri)
ri
- parseFrom(byte[])
static String prettyPrint(String encodedRegionName)
encodedRegionName
- The encoded regionname.hbase:meta
if passed 1028785192
else returns
encodedRegionName
static byte[] createRegionName(TableName tableName, byte[] startKey, long regionid, boolean newFormat)
tableName
- 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)
tableName
- 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)
tableName
- startKey
- Can be nullregionid
- Region id (Usually timestamp from when region was created).replicaId
- 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)
tableName
- 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)
tableName
- startKey
- Can be nullid
- Region id (Usually timestamp from when region was created).replicaId
- 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
regionName
- IOException
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 serializeIOException
static 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).ri
- IOException
static RegionInfo parseFrom(DataInputStream in) throws IOException
toDelimitedByteArray(RegionInfo)
.in
- IOException
static 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[] bufferIOException
Copyright © 2007–2019 Cloudera. All rights reserved.