|
||||||||||
| 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 HRegionInfo |
FIRST_META_REGIONINFO
HRegionInfo for first meta region |
static int |
MD5_HEX_LENGTH
|
static java.lang.String |
NO_HASH
|
static HRegionInfo |
ROOT_REGIONINFO
HRegionInfo for root region |
protected HTableDescriptor |
tableDesc
|
| Constructor Summary | |
|---|---|
HRegionInfo()
Default constructor - creates empty object |
|
HRegionInfo(HRegionInfo other)
Costruct a copy of another HRegionInfo |
|
HRegionInfo(HTableDescriptor tableDesc,
byte[] startKey,
byte[] endKey)
Construct HRegionInfo with explicit parameters |
|
HRegionInfo(HTableDescriptor tableDesc,
byte[] startKey,
byte[] endKey,
boolean split)
Construct HRegionInfo with explicit parameters |
|
HRegionInfo(HTableDescriptor tableDesc,
byte[] startKey,
byte[] endKey,
boolean split,
long regionid)
Construct HRegionInfo with explicit parameters |
|
| 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,
java.lang.String id,
boolean newFormat)
Make a region name of passed parameters. |
static java.lang.String |
encodeRegionName(byte[] regionName)
|
boolean |
equals(java.lang.Object o)
|
KeyValue.KVComparator |
getComparator()
|
java.lang.String |
getEncodedName()
|
byte[] |
getEncodedNameAsBytes()
|
byte[] |
getEndKey()
|
long |
getRegionId()
|
byte[] |
getRegionName()
|
java.lang.String |
getRegionNameAsString()
|
byte[] |
getStartKey()
|
HTableDescriptor |
getTableDesc()
|
static byte[] |
getTableName(byte[] regionName)
Gets the table name from the specified region name. |
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 java.lang.String |
prettyPrint(java.lang.String encodedRegionName)
Use logging. |
void |
readFields(java.io.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)
|
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MD5_HEX_LENGTH
public static final int DELIMITER
public static final HRegionInfo ROOT_REGIONINFO
public static final HRegionInfo FIRST_META_REGIONINFO
protected HTableDescriptor tableDesc
public static final java.lang.String NO_HASH
| Constructor Detail |
|---|
public HRegionInfo()
public HRegionInfo(HTableDescriptor tableDesc,
byte[] startKey,
byte[] endKey)
throws java.lang.IllegalArgumentException
tableDesc - the table descriptorstartKey - first key in regionendKey - end of key range
java.lang.IllegalArgumentException
public HRegionInfo(HTableDescriptor tableDesc,
byte[] startKey,
byte[] endKey,
boolean split)
throws java.lang.IllegalArgumentException
tableDesc - 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.
java.lang.IllegalArgumentException
public HRegionInfo(HTableDescriptor tableDesc,
byte[] startKey,
byte[] endKey,
boolean split,
long regionid)
throws java.lang.IllegalArgumentException
tableDesc - 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.
java.lang.IllegalArgumentExceptionpublic HRegionInfo(HRegionInfo other)
other - | Method Detail |
|---|
public static java.lang.String encodeRegionName(byte[] regionName)
regionName -
public static java.lang.String prettyPrint(java.lang.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,
java.lang.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 java.io.IOException
regionName -
java.io.IOExceptionpublic long getRegionId()
public byte[] getRegionName()
getRegionNameAsString()public java.lang.String getRegionNameAsString()
public java.lang.String getEncodedName()
public byte[] getEncodedNameAsBytes()
public byte[] getStartKey()
public byte[] getEndKey()
public boolean containsRange(byte[] rangeStartKey,
byte[] rangeEndKey)
java.lang.IllegalArgumentException - if the range passed is invalid (ie end < start)public boolean containsRow(byte[] row)
public HTableDescriptor getTableDesc()
public void setTableDesc(HTableDescriptor newDesc)
newDesc - new table descriptor to usepublic boolean isRootRegion()
public boolean isMetaTable()
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 java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public boolean equals(java.lang.Object o)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public byte getVersion()
getVersion in class org.apache.hadoop.io.VersionedWritable
public void write(java.io.DataOutput out)
throws java.io.IOException
write in interface org.apache.hadoop.io.Writablewrite in class org.apache.hadoop.io.VersionedWritablejava.io.IOException
public void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.WritablereadFields in class org.apache.hadoop.io.VersionedWritablejava.io.IOExceptionpublic int compareTo(HRegionInfo o)
compareTo in interface java.lang.Comparable<HRegionInfo>public KeyValue.KVComparator getComparator()
KeyValues.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||