|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.HStoreKey
public class HStoreKey
A Key for a stored row.
Nested Class Summary | |
---|---|
static class |
HStoreKey.HStoreKeyWritableComparator
Passed as comparator for memcache and for store files. |
Field Summary | |
---|---|
static char |
COLUMN_FAMILY_DELIMITER
Colon character in UTF-8 |
Constructor Summary | |
---|---|
HStoreKey()
Default constructor used in conjunction with Writable interface |
|
HStoreKey(byte[] row)
Create an HStoreKey specifying only the row The column defaults to the empty string, the time stamp defaults to Long.MAX_VALUE and the table defaults to empty string |
|
HStoreKey(byte[] row,
byte[] column)
Create an HStoreKey specifying the row and column names The timestamp defaults to LATEST_TIMESTAMP and table name defaults to the empty string |
|
HStoreKey(byte[] row,
byte[] column,
HRegionInfo regionInfo)
Create an HStoreKey specifying the row, column names and table name The timestamp defaults to LATEST_TIMESTAMP |
|
HStoreKey(byte[] row,
byte[] column,
long timestamp)
Create an HStoreKey specifying all the fields with unspecified table Does not make copies of the passed byte arrays. |
|
HStoreKey(byte[] row,
byte[] column,
long timestamp,
HRegionInfo regionInfo)
Create an HStoreKey specifying all the fields with specified table Does not make copies of the passed byte arrays. |
|
HStoreKey(byte[] row,
HRegionInfo hri)
Create an HStoreKey specifying the row and timestamp The column and table names default to the empty string |
|
HStoreKey(byte[] row,
long timestamp)
Create an HStoreKey specifying the row and timestamp The column and table names default to the empty string |
|
HStoreKey(byte[] row,
long timestamp,
HRegionInfo hri)
Create an HStoreKey specifying the row and timestamp The column and table names default to the empty string |
|
HStoreKey(HStoreKey other)
Constructs a new HStoreKey from another |
|
HStoreKey(String row)
Create an HStoreKey specifying only the row The column defaults to the empty string, the time stamp defaults to Long.MAX_VALUE and the table defaults to empty string |
|
HStoreKey(String row,
long timestamp)
Create an HStoreKey specifying the row and timestamp The column and table names default to the empty string |
|
HStoreKey(String row,
String column)
Create an HStoreKey specifying the row and column names The timestamp defaults to LATEST_TIMESTAMP and table name defaults to the empty string |
|
HStoreKey(String row,
String column,
long timestamp,
HRegionInfo regionInfo)
Create an HStoreKey specifying all the fields Does not make copies of the passed byte arrays. |
Method Summary | |
---|---|
static byte[] |
addDelimiter(byte[] family)
|
int |
compareTo(HStoreKey o)
|
static int |
compareTwoRowKeys(HRegionInfo regionInfo,
byte[] rowA,
byte[] rowB)
Utility method to compare two row keys. |
boolean |
equals(Object obj)
|
static boolean |
equalsTwoRowKeys(HRegionInfo regionInfo,
byte[] rowA,
byte[] rowB)
Utility method to check if two row keys are equal. |
static byte[] |
getBytes(HStoreKey hsk)
Returns row and column bytes out of an HStoreKey. |
byte[] |
getColumn()
|
static byte[] |
getFamily(byte[] column)
|
static int |
getFamilyDelimiterIndex(byte[] b)
|
static Integer |
getFamilyMapKey(byte[] column)
|
HRegionInfo |
getHRegionInfo()
|
static byte[] |
getQualifier(byte[] column)
|
byte[] |
getRow()
|
long |
getSize()
|
long |
getTimestamp()
|
int |
hashCode()
|
boolean |
matchesRowCol(HStoreKey other)
Compares the row and column of two keys |
boolean |
matchesRowFamily(HStoreKey that)
Compares the row and column family of two keys |
boolean |
matchesWithoutColumn(HStoreKey other)
Compares the row and timestamp of two keys |
static boolean |
matchingFamily(byte[] family,
byte[] column)
|
static byte[][] |
parseColumn(byte[] c)
|
void |
readFields(DataInput in)
|
void |
set(HStoreKey k)
Set the value of this HStoreKey from the supplied key |
void |
setColumn(byte[] c)
Change the value of the column in this key |
void |
setHRegionInfo(HRegionInfo hri)
|
void |
setRow(byte[] newrow)
Change the value of the row key |
void |
setVersion(long timestamp)
Change the value of the timestamp field |
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 char COLUMN_FAMILY_DELIMITER
Constructor Detail |
---|
public HStoreKey()
public HStoreKey(byte[] row)
row
- - row keypublic HStoreKey(String row)
row
- - row keypublic HStoreKey(byte[] row, HRegionInfo hri)
row
- row keyhri
- public HStoreKey(byte[] row, long timestamp, HRegionInfo hri)
row
- row keytimestamp
- timestamp valuehri
- HRegionInfopublic HStoreKey(byte[] row, long timestamp)
row
- row keytimestamp
- timestamp valuepublic HStoreKey(String row, long timestamp)
row
- row keytimestamp
- timestamp valuepublic HStoreKey(String row, String column)
row
- row keycolumn
- column keypublic HStoreKey(byte[] row, byte[] column)
row
- row keycolumn
- column keypublic HStoreKey(byte[] row, byte[] column, HRegionInfo regionInfo)
row
- row keycolumn
- column keyregionInfo
- region infopublic HStoreKey(String row, String column, long timestamp, HRegionInfo regionInfo)
row
- row keycolumn
- column keytimestamp
- timestamp valueregionInfo
- region infopublic HStoreKey(byte[] row, byte[] column, long timestamp)
row
- row keycolumn
- column keytimestamp
- timestamp valuepublic HStoreKey(byte[] row, byte[] column, long timestamp, HRegionInfo regionInfo)
row
- row keycolumn
- column keytimestamp
- timestamp valueregionInfo
- region infopublic HStoreKey(HStoreKey other)
other
- the source keyMethod Detail |
---|
public long getSize()
public void setRow(byte[] newrow)
newrow
- new row key valuepublic void setColumn(byte[] c)
c
- new column family valuepublic void setVersion(long timestamp)
timestamp
- new timestamp valuepublic void set(HStoreKey k)
k
- key value to copypublic byte[] getRow()
public byte[] getColumn()
public long getTimestamp()
public HRegionInfo getHRegionInfo()
public void setHRegionInfo(HRegionInfo hri)
hri
- public boolean matchesRowCol(HStoreKey other)
other
- Key to compare against. Compares row and column.
matchesWithoutColumn(HStoreKey)
,
matchesRowFamily(HStoreKey)
public boolean matchesWithoutColumn(HStoreKey other)
other
- Key to copmare against. Compares row and timestamp.
other
matchesRowCol(HStoreKey)
,
matchesRowFamily(HStoreKey)
public boolean matchesRowFamily(HStoreKey that)
that
- Key to compare against. Compares row and column family
matchesRowCol(HStoreKey)
,
matchesWithoutColumn(HStoreKey)
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(HStoreKey o)
compareTo
in interface Comparable<HStoreKey>
public static byte[] getFamily(byte[] column) throws ColumnNameParseException
column
-
column
family prefix only
(Does not include the colon DELIMITER).
ColumnNameParseException
parseColumn(byte[])
public static Integer getFamilyMapKey(byte[] column)
column
-
public static boolean matchingFamily(byte[] family, byte[] column)
family
- column
-
column
has a family of family
.public static byte[] addDelimiter(byte[] family)
family
-
family
plus the family delimiter.public static byte[] getQualifier(byte[] column)
column
-
column
qualifier suffix.parseColumn(byte[])
public static byte[][] parseColumn(byte[] c) throws ColumnNameParseException
c
- Column name
c
and whose second element is the
column qualifier.
ColumnNameParseException
public static int getFamilyDelimiterIndex(byte[] b)
b
-
public static byte[] getBytes(HStoreKey hsk)
hsk
- Store key.
public static int compareTwoRowKeys(HRegionInfo regionInfo, byte[] rowA, byte[] rowB)
regionInfo
- rowA
- rowB
-
public static boolean equalsTwoRowKeys(HRegionInfo regionInfo, byte[] rowA, byte[] rowB)
regionInfo
- rowA
- rowB
-
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |