|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.io.VersionedWritable
org.apache.hadoop.hbase.HRegionInfo
public class HRegionInfo
HRegion information. Contains HRegion id, start and end keys, a reference to this HRegions' table descriptor, etc.
Field Summary | |
---|---|
static int |
DELIMITER
delimiter used between portions of a region name |
static String |
ENCODED_REGION_NAME_REGEX
A non-capture group so that this can be embedded. |
static HRegionInfo |
FIRST_META_REGIONINFO
HRegionInfo for first meta region |
static int |
MD5_HEX_LENGTH
|
static String |
NO_HASH
|
static HRegionInfo |
ROOT_REGIONINFO
HRegionInfo for root region |
static byte |
VERSION
|
static byte |
VERSION_PRE_092
|
Constructor Summary | |
---|---|
HRegionInfo()
Default constructor - creates empty object |
|
HRegionInfo(byte[] tableName)
|
|
HRegionInfo(byte[] tableName,
byte[] startKey,
byte[] endKey)
Construct HRegionInfo with explicit parameters |
|
HRegionInfo(byte[] tableName,
byte[] startKey,
byte[] endKey,
boolean split)
Construct HRegionInfo with explicit parameters |
|
HRegionInfo(byte[] tableName,
byte[] startKey,
byte[] endKey,
boolean split,
long regionid)
Construct HRegionInfo with explicit parameters |
|
HRegionInfo(HRegionInfo other)
Costruct a copy of another HRegionInfo |
|
HRegionInfo(HRegionInfo090x other)
Used only for migration |
Method Summary | |
---|---|
int |
compareTo(HRegionInfo o)
|
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. |
static byte[] |
createRegionName(byte[] tableName,
byte[] startKey,
byte[] id,
boolean newFormat)
Make a region name of passed parameters. |
static byte[] |
createRegionName(byte[] tableName,
byte[] startKey,
long regionid,
boolean newFormat)
Make a region name of passed parameters. |
static byte[] |
createRegionName(byte[] tableName,
byte[] startKey,
String id,
boolean newFormat)
Make a region name of passed parameters. |
static String |
encodeRegionName(byte[] regionName)
|
boolean |
equals(Object o)
|
KeyValue.KVComparator |
getComparator()
|
String |
getEncodedName()
|
byte[] |
getEncodedNameAsBytes()
|
byte[] |
getEndKey()
|
long |
getRegionId()
|
byte[] |
getRegionName()
|
String |
getRegionNameAsString()
|
byte[] |
getStartKey()
|
HTableDescriptor |
getTableDesc()
Deprecated. Do not use; expensive call use HRegionInfo.getTableNameAsString() in place of HRegionInfo.getTableDesc().getNameAsString() |
byte[] |
getTableName()
Get current table name of the region |
static byte[] |
getTableName(byte[] regionName)
Gets the table name from the specified region name. |
String |
getTableNameAsString()
Get current table name as string |
byte |
getVersion()
|
int |
hashCode()
|
boolean |
isMetaRegion()
|
boolean |
isMetaTable()
|
boolean |
isOffline()
|
boolean |
isRootRegion()
|
boolean |
isSplit()
|
boolean |
isSplitParent()
|
static byte[][] |
parseRegionName(byte[] regionName)
Separate elements of a regionName. |
static String |
prettyPrint(String encodedRegionName)
Use logging. |
void |
readFields(DataInput in)
|
void |
setOffline(boolean offLine)
The parent of a region split is offline while split daughters hold references to the parent. |
void |
setSplit(boolean split)
|
void |
setTableDesc(HTableDescriptor newDesc)
Deprecated. Do not use; expensive call |
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte VERSION_PRE_092
public static final byte VERSION
public static final int MD5_HEX_LENGTH
public static final String ENCODED_REGION_NAME_REGEX
public static final int DELIMITER
public static final HRegionInfo ROOT_REGIONINFO
public static final HRegionInfo FIRST_META_REGIONINFO
public static final String NO_HASH
Constructor Detail |
---|
public HRegionInfo()
public HRegionInfo(HRegionInfo090x other)
other
- HRegionInfoForMigrationpublic HRegionInfo(byte[] tableName)
public HRegionInfo(byte[] tableName, byte[] startKey, byte[] endKey) throws IllegalArgumentException
tableName
- the table namestartKey
- first key in regionendKey
- end of key range
IllegalArgumentException
public HRegionInfo(byte[] tableName, byte[] startKey, byte[] endKey, boolean split) throws IllegalArgumentException
tableName
- the table descriptorstartKey
- first key in regionendKey
- end of key rangesplit
- true if this region has split and we have daughter regions
regions that may or may not hold references to this region.
IllegalArgumentException
public HRegionInfo(byte[] tableName, byte[] startKey, byte[] endKey, boolean split, long regionid) throws IllegalArgumentException
tableName
- the table descriptorstartKey
- first key in regionendKey
- end of key rangesplit
- true if this region has split and we have daughter regions
regions that may or may not hold references to this region.regionid
- Region id to use.
IllegalArgumentException
public HRegionInfo(HRegionInfo other)
other
- Method Detail |
---|
public static String encodeRegionName(byte[] regionName)
regionName
-
public static String prettyPrint(String encodedRegionName)
encodedRegionName
- The encoded regionname.
-ROOT-
if passed 70236052
or
.META.
if passed 1028785192 else returns
encodedRegionName
public static byte[] createRegionName(byte[] 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?).
public static byte[] createRegionName(byte[] 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?).
public static byte[] createRegionName(byte[] 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?).
public static byte[] getTableName(byte[] regionName)
regionName
-
public static byte[][] parseRegionName(byte[] regionName) throws IOException
regionName
-
IOException
public long getRegionId()
public byte[] getRegionName()
getRegionNameAsString()
public String getRegionNameAsString()
public String getEncodedName()
public byte[] getEncodedNameAsBytes()
public byte[] getStartKey()
public byte[] getEndKey()
public byte[] getTableName()
public String getTableNameAsString()
public boolean containsRange(byte[] rangeStartKey, byte[] rangeEndKey)
IllegalArgumentException
- if the range passed is invalid (ie end < start)public boolean containsRow(byte[] row)
@Deprecated public HTableDescriptor getTableDesc()
@Deprecated public void setTableDesc(HTableDescriptor newDesc)
newDesc
- new table descriptor to usepublic boolean isRootRegion()
public boolean isMetaTable()
.META.
or -ROOT-
public boolean isMetaRegion()
public boolean isSplit()
public void setSplit(boolean split)
split
- set split statuspublic boolean isOffline()
public void setOffline(boolean offLine)
offLine
- Set online/offline status.public boolean isSplitParent()
public String toString()
toString
in class Object
Object.toString()
public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public byte getVersion()
getVersion
in class org.apache.hadoop.io.VersionedWritable
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class org.apache.hadoop.io.VersionedWritable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class org.apache.hadoop.io.VersionedWritable
IOException
public int compareTo(HRegionInfo o)
compareTo
in interface Comparable<HRegionInfo>
public KeyValue.KVComparator getComparator()
KeyValue
s.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |