|
||||||||||
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.
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 and the time stamp defaults to Long.MAX_VALUE |
|
HStoreKey(byte[] row,
byte[] column)
Create an HStoreKey specifying the row and column names The timestamp defaults to LATEST_TIMESTAMP |
|
HStoreKey(byte[] row,
byte[] column,
long timestamp)
Create an HStoreKey specifying all the fields Does not make copies of the passed byte arrays. |
|
HStoreKey(byte[] row,
long timestamp)
Create an HStoreKey specifying the row and timestamp The column name defaults 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 and the time stamp defaults to Long.MAX_VALUE |
|
HStoreKey(String row,
long timestamp)
Create an HStoreKey specifying the row and timestamp The column name defaults to the empty string |
|
HStoreKey(String row,
String column)
Create an HStoreKey specifying the row and column names The timestamp defaults to LATEST_TIMESTAMP |
|
HStoreKey(String row,
String column,
long timestamp)
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(Object o)
|
boolean |
equals(Object obj)
|
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)
|
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 |
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, 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(String row, String column, long timestamp)
row
- row keycolumn
- column keytimestamp
- timestamp valuepublic HStoreKey(byte[] row, byte[] column, long timestamp)
row
- row keycolumn
- column keytimestamp
- timestamp valuepublic 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 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(Object o)
compareTo
in interface Comparable
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 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 |