org.apache.hadoop.hbase
Class HStoreKey

java.lang.Object
  extended by org.apache.hadoop.hbase.HStoreKey
All Implemented Interfaces:
Comparable<HStoreKey>, HeapSize, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<HStoreKey>

Deprecated. Replaced by KeyValue.

public class HStoreKey
extends Object
implements org.apache.hadoop.io.WritableComparable<HStoreKey>, HeapSize

A Key for a stored row.


Nested Class Summary
static class HStoreKey.HStoreKeyComparator
          Deprecated. Passed as comparator for memcache and for store files.
static class HStoreKey.HStoreKeyMetaComparator
          Deprecated. Passed as comparator for memcache and for store files.
static class HStoreKey.HStoreKeyRootComparator
          Deprecated. Passed as comparator for memcache and for store files.
static class HStoreKey.MetaStoreKeyComparator
          Deprecated. StoreKeyComparator for the .META.
static class HStoreKey.RootStoreKeyComparator
          Deprecated. StoreKeyComparator for the -ROOT- table.
static class HStoreKey.StoreKeyComparator
          Deprecated. RawComparator for plain -- i.e.
 
Field Summary
static char COLUMN_FAMILY_DELIMITER
          Deprecated. Colon character in UTF-8
static int ESTIMATED_HEAP_TAX
          Deprecated. Estimated size tax paid for each instance of HSK.
 
Constructor Summary
HStoreKey()
          Deprecated. Default constructor used in conjunction with Writable interface
HStoreKey(byte[] row)
          Deprecated. 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)
          Deprecated. 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, long timestamp)
          Deprecated. Create an HStoreKey specifying all the fields with specified table Does not make copies of the passed byte arrays.
HStoreKey(byte[] row, long timestamp)
          Deprecated. Create an HStoreKey specifying the row and timestamp The column and table names default to the empty string
HStoreKey(ByteBuffer bb)
          Deprecated.  
HStoreKey(HStoreKey other)
          Deprecated. Constructs a new HStoreKey from another
HStoreKey(String row)
          Deprecated. 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, String column)
          Deprecated. 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)
          Deprecated. Create an HStoreKey specifying all the fields Does not make copies of the passed byte arrays.
 
Method Summary
static byte[] addDelimiter(byte[] family)
          Deprecated.  
protected static int compareMetaRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength)
          Deprecated.  
protected static int compareRootRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength)
          Deprecated.  
 int compareTo(HStoreKey o)
          Deprecated. Use Comparators instead. This can give wrong results.
static HStoreKey create(byte[] b)
          Deprecated. Create a store key.
static HStoreKey create(byte[] b, int offset, int length)
          Deprecated. Create a store key.
static HStoreKey create(ByteBuffer bb)
          Deprecated. Create a store key.
 boolean equals(Object obj)
          Deprecated.  
static boolean equalsTwoRowKeys(byte[] rowA, byte[] rowB)
          Deprecated. Utility method to check if two row keys are equal.
 byte[] getBytes()
          Deprecated.  
static byte[] getBytes(byte[] row)
          Deprecated.  
static byte[] getBytes(byte[] row, byte[] column, long ts)
          Deprecated.  
static byte[] getBytes(HStoreKey hsk)
          Deprecated. Return serialize hsk bytes.
 byte[] getColumn()
          Deprecated.  
static byte[] getColumn(ByteBuffer bb)
          Deprecated.  
static HStoreKey.StoreKeyComparator getComparator(byte[] tablename)
          Deprecated.  
static byte[] getFamily(byte[] column)
          Deprecated.  
static int getFamilyDelimiterIndex(byte[] b)
          Deprecated.  
static Integer getFamilyMapKey(byte[] column)
          Deprecated.  
static byte[] getQualifier(byte[] column)
          Deprecated.  
static HStoreKey.StoreKeyComparator getRawComparator(HRegionInfo hri)
          Deprecated.  
 byte[] getRow()
          Deprecated.  
static byte[] getRow(ByteBuffer bb)
          Deprecated.  
static int getSerializedSize(HStoreKey hsk)
          Deprecated.  
 long getTimestamp()
          Deprecated.  
static long getTimestamp(ByteBuffer bb)
          Deprecated.  
static org.apache.hadoop.io.WritableComparator getWritableComparator(HRegionInfo hri)
          Deprecated.  
 int hashCode()
          Deprecated.  
 long heapSize()
          Deprecated.  
 boolean matchesRowCol(HStoreKey other)
          Deprecated. Compares the row and column of two keys
 boolean matchesRowFamily(HStoreKey that)
          Deprecated. Compares the row and column family of two keys
 boolean matchesWithoutColumn(HStoreKey other)
          Deprecated. Compares the row and timestamp of two keys
static boolean matchingFamily(byte[] family, byte[] column)
          Deprecated.  
static byte[][] parseColumn(byte[] c)
          Deprecated.  
 void readFields(DataInput in)
          Deprecated.  
 void set(HStoreKey k)
          Deprecated. Set the value of this HStoreKey from the supplied key
 void setColumn(byte[] c)
          Deprecated. Change the value of the column in this key
 void setRow(byte[] newrow)
          Deprecated. Change the value of the row key
 void setVersion(long timestamp)
          Deprecated. Change the value of the timestamp field
 String toString()
          Deprecated.  
 void write(DataOutput out)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMN_FAMILY_DELIMITER

public static final char COLUMN_FAMILY_DELIMITER
Deprecated. 
Colon character in UTF-8

See Also:
Constant Field Values

ESTIMATED_HEAP_TAX

public static final int ESTIMATED_HEAP_TAX
Deprecated. 
Estimated size tax paid for each instance of HSK. Estimate based on study of jhat and jprofiler numbers.

See Also:
Constant Field Values
Constructor Detail

HStoreKey

public HStoreKey()
Deprecated. 
Default constructor used in conjunction with Writable interface


HStoreKey

public HStoreKey(byte[] row)
Deprecated. 
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

Parameters:
row - - row key

HStoreKey

public HStoreKey(String row)
Deprecated. 
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

Parameters:
row - - row key

HStoreKey

public HStoreKey(byte[] row,
                 long timestamp)
Deprecated. 
Create an HStoreKey specifying the row and timestamp The column and table names default to the empty string

Parameters:
row - row key
timestamp - timestamp value

HStoreKey

public HStoreKey(String row,
                 String column)
Deprecated. 
Create an HStoreKey specifying the row and column names The timestamp defaults to LATEST_TIMESTAMP and table name defaults to the empty string

Parameters:
row - row key
column - column key

HStoreKey

public HStoreKey(byte[] row,
                 byte[] column)
Deprecated. 
Create an HStoreKey specifying the row and column names The timestamp defaults to LATEST_TIMESTAMP and table name defaults to the empty string

Parameters:
row - row key
column - column key

HStoreKey

public HStoreKey(String row,
                 String column,
                 long timestamp)
Deprecated. 
Create an HStoreKey specifying all the fields Does not make copies of the passed byte arrays. Presumes the passed arrays immutable.

Parameters:
row - row key
column - column key
timestamp - timestamp value

HStoreKey

public HStoreKey(byte[] row,
                 byte[] column,
                 long timestamp)
Deprecated. 
Create an HStoreKey specifying all the fields with specified table Does not make copies of the passed byte arrays. Presumes the passed arrays immutable.

Parameters:
row - row key
column - column key
timestamp - timestamp value

HStoreKey

public HStoreKey(HStoreKey other)
Deprecated. 
Constructs a new HStoreKey from another

Parameters:
other - the source key

HStoreKey

public HStoreKey(ByteBuffer bb)
Deprecated. 
Method Detail

setRow

public void setRow(byte[] newrow)
Deprecated. 
Change the value of the row key

Parameters:
newrow - new row key value

setColumn

public void setColumn(byte[] c)
Deprecated. 
Change the value of the column in this key

Parameters:
c - new column family value

setVersion

public void setVersion(long timestamp)
Deprecated. 
Change the value of the timestamp field

Parameters:
timestamp - new timestamp value

set

public void set(HStoreKey k)
Deprecated. 
Set the value of this HStoreKey from the supplied key

Parameters:
k - key value to copy

getRow

public byte[] getRow()
Deprecated. 
Returns:
value of row key

getColumn

public byte[] getColumn()
Deprecated. 
Returns:
value of column

getTimestamp

public long getTimestamp()
Deprecated. 
Returns:
value of timestamp

matchesRowCol

public boolean matchesRowCol(HStoreKey other)
Deprecated. 
Compares the row and column of two keys

Parameters:
other - Key to compare against. Compares row and column.
Returns:
True if same row and column.
See Also:
matchesWithoutColumn(HStoreKey), matchesRowFamily(HStoreKey)

matchesWithoutColumn

public boolean matchesWithoutColumn(HStoreKey other)
Deprecated. 
Compares the row and timestamp of two keys

Parameters:
other - Key to copmare against. Compares row and timestamp.
Returns:
True if same row and timestamp is greater than other
See Also:
matchesRowCol(HStoreKey), matchesRowFamily(HStoreKey)

matchesRowFamily

public boolean matchesRowFamily(HStoreKey that)
Deprecated. 
Compares the row and column family of two keys

Parameters:
that - Key to compare against. Compares row and column family
Returns:
true if same row and column family
See Also:
matchesRowCol(HStoreKey), matchesWithoutColumn(HStoreKey)

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object obj)
Deprecated. 
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Deprecated. 
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

compareTo

@Deprecated
public int compareTo(HStoreKey o)
Deprecated. Use Comparators instead. This can give wrong results.

Specified by:
compareTo in interface Comparable<HStoreKey>
Parameters:
o -
Returns:
int

getFamily

public static byte[] getFamily(byte[] column)
                        throws ColumnNameParseException
Deprecated. 
Parameters:
column -
Returns:
New byte array that holds column family prefix only (Does not include the colon DELIMITER).
Throws:
ColumnNameParseException
See Also:
parseColumn(byte[])

getFamilyMapKey

public static Integer getFamilyMapKey(byte[] column)
Deprecated. 
Parameters:
column -
Returns:
Return hash of family portion of passed column.

matchingFamily

public static boolean matchingFamily(byte[] family,
                                     byte[] column)
Deprecated. 
Parameters:
family -
column -
Returns:
True if column has a family of family.

addDelimiter

public static byte[] addDelimiter(byte[] family)
Deprecated. 
Parameters:
family -
Returns:
Return family plus the family delimiter.

getQualifier

public static byte[] getQualifier(byte[] column)
Deprecated. 
Parameters:
column -
Returns:
New byte array that holds column qualifier suffix.
See Also:
parseColumn(byte[])

parseColumn

public static byte[][] parseColumn(byte[] c)
                            throws ColumnNameParseException
Deprecated. 
Parameters:
c - Column name
Returns:
Return array of size two whose first element has the family prefix of passed column c and whose second element is the column qualifier.
Throws:
ColumnNameParseException

getFamilyDelimiterIndex

public static int getFamilyDelimiterIndex(byte[] b)
Deprecated. 
Parameters:
b -
Returns:
Index of the family-qualifier colon delimiter character in passed buffer.

equalsTwoRowKeys

public static boolean equalsTwoRowKeys(byte[] rowA,
                                       byte[] rowB)
Deprecated. 
Utility method to check if two row keys are equal. This is required because of the meta delimiters This is a hack

Parameters:
rowA -
rowB -
Returns:
if it's equal

write

public void write(DataOutput out)
           throws IOException
Deprecated. 
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Deprecated. 
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

getSerializedSize

public static int getSerializedSize(HStoreKey hsk)
Deprecated. 
Parameters:
hsk -
Returns:
Size of this key in serialized bytes.

heapSize

public long heapSize()
Deprecated. 
Specified by:
heapSize in interface HeapSize
Returns:
Approximate 'exclusive deep size' of implementing object. Includes count of payload and hosting object sizings.

getBytes

public byte[] getBytes()
                throws IOException
Deprecated. 
Returns:
The bytes of hsk gotten by running its Writable.write(java.io.DataOutput) method.
Throws:
IOException

getBytes

public static byte[] getBytes(HStoreKey hsk)
                       throws IOException
Deprecated. 
Return serialize hsk bytes. Note, this method's implementation has changed. Used to just return row and column. This is a customized version of Writables.getBytes(Writable)

Parameters:
hsk - Instance
Returns:
The bytes of hsk gotten by running its Writable.write(java.io.DataOutput) method.
Throws:
IOException

getBytes

public static byte[] getBytes(byte[] row)
                       throws IOException
Deprecated. 
Parameters:
row - Can't be null
Returns:
Passed arguments as a serialized HSK.
Throws:
IOException

getBytes

public static byte[] getBytes(byte[] row,
                              byte[] column,
                              long ts)
                       throws IOException
Deprecated. 
Parameters:
row - Can't be null
column - Can be null
ts -
Returns:
Passed arguments as a serialized HSK.
Throws:
IOException

getRow

public static byte[] getRow(ByteBuffer bb)
Deprecated. 
Parameters:
bb - ByteBuffer that contains serialized HStoreKey
Returns:
Row

getColumn

public static byte[] getColumn(ByteBuffer bb)
Deprecated. 
Parameters:
bb - ByteBuffer that contains serialized HStoreKey
Returns:
Column

getTimestamp

public static long getTimestamp(ByteBuffer bb)
Deprecated. 
Parameters:
bb - ByteBuffer that contains serialized HStoreKey
Returns:
Timestamp

create

public static HStoreKey create(ByteBuffer bb)
                        throws IOException
Deprecated. 
Create a store key.

Parameters:
bb -
Returns:
HStoreKey instance made of the passed b.
Throws:
IOException

create

public static HStoreKey create(byte[] b)
                        throws IOException
Deprecated. 
Create a store key.

Parameters:
b - Serialized HStoreKey; a byte array with a row only in it won't do. It must have all the vints denoting r/c/ts lengths.
Returns:
HStoreKey instance made of the passed b.
Throws:
IOException

create

public static HStoreKey create(byte[] b,
                               int offset,
                               int length)
                        throws IOException
Deprecated. 
Create a store key.

Parameters:
b - Serialized HStoreKey
offset -
length -
Returns:
HStoreKey instance made of the passed b.
Throws:
IOException

compareRootRows

protected static int compareRootRows(byte[] left,
                                     int loffset,
                                     int llength,
                                     byte[] right,
                                     int roffset,
                                     int rlength)
Deprecated. 

compareMetaRows

protected static int compareMetaRows(byte[] left,
                                     int loffset,
                                     int llength,
                                     byte[] right,
                                     int roffset,
                                     int rlength)
Deprecated. 

getWritableComparator

public static org.apache.hadoop.io.WritableComparator getWritableComparator(HRegionInfo hri)
Deprecated. 
Parameters:
hri -
Returns:
Compatible comparator

getRawComparator

public static HStoreKey.StoreKeyComparator getRawComparator(HRegionInfo hri)
Deprecated. 
Parameters:
hri -
Returns:
Compatible raw comparator

getComparator

public static HStoreKey.StoreKeyComparator getComparator(byte[] tablename)
Deprecated. 
Parameters:
tablename -
Returns:
Compatible raw comparator


Copyright © 2009 The Apache Software Foundation