|
||||||||||
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(HStoreKey other)
Constructs a new HStoreKey from another |
|
HStoreKey(Text 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(Text row,
long timestamp)
Create an HStoreKey specifying the row and timestamp The column name defaults to the empty string |
|
HStoreKey(Text row,
Text column)
Create an HStoreKey specifying the row and column names The timestamp defaults to LATEST_TIMESTAMP |
|
HStoreKey(Text row,
Text column,
long timestamp)
Create an HStoreKey specifying all the fields |
Method Summary | |
---|---|
int |
compareTo(Object o)
|
boolean |
equals(Object obj)
|
static TextSequence |
extractFamily(Text col)
Extracts the column family name from a column For example, returns 'info' if the specified column was 'info:server' |
static TextSequence |
extractFamily(Text col,
boolean withColon)
Extracts the column family name from a column For example, returns 'info' if the specified column was 'info:server' |
static TextSequence |
extractQualifier(Text col)
Extracts the column qualifier, the portion that follows the colon (':') family/qualifier separator. |
static byte[] |
getBytes(HStoreKey hsk)
Returns row and column bytes out of an HStoreKey. |
Text |
getColumn()
|
Text |
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 |
void |
readFields(DataInput in)
Deserialize the fields of this object from in . |
void |
set(HStoreKey k)
Set the value of this HStoreKey from the supplied key |
void |
setColumn(Text newcol)
Change the value of the column key |
void |
setRow(Text 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)
Serialize the fields of this object to 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(Text row)
row
- - row keypublic HStoreKey(Text row, long timestamp)
row
- row keytimestamp
- timestamp valuepublic HStoreKey(Text row, Text column)
row
- row keycolumn
- column keypublic HStoreKey(Text row, Text column, long timestamp)
row
- row keycolumn
- column keytimestamp
- timestamp valuepublic HStoreKey(HStoreKey other)
other
- the source keyMethod Detail |
---|
public long getSize()
public void setRow(Text newrow)
newrow
- new row key valuepublic void setColumn(Text newcol)
newcol
- new column key valuepublic void setVersion(long timestamp)
timestamp
- new timestamp valuepublic void set(HStoreKey k)
k
- key value to copypublic Text getRow()
public Text 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) throws InvalidColumnNameException
that
- Key to compare against. Compares row and column family
InvalidColumnNameException
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 void write(DataOutput out) throws IOException
out
.
write
in interface Writable
out
- DataOuput
to serialize this object into.
IOException
public void readFields(DataInput in) throws IOException
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.
IOException
public static TextSequence extractFamily(Text col) throws InvalidColumnNameException
col
- name of column
col
. If col
is reused, make a new Text of
the result by calling TextSequence.toText()
.
InvalidColumnNameException
public static TextSequence extractFamily(Text col, boolean withColon) throws InvalidColumnNameException
col
- name of column
col
. If col
is reused, make a new Text of
the result by calling TextSequence.toText()
.
InvalidColumnNameException
public static TextSequence extractQualifier(Text col) throws InvalidColumnNameException
col
- name of column
col
. If col
is reused, make a new Text of
the result by calling TextSequence.toText()
.
InvalidColumnNameException
public static byte[] getBytes(HStoreKey hsk) throws UnsupportedEncodingException
hsk
- Store key.
UnsupportedEncodingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |