org.apache.hadoop.hbase.io
Class Cell

java.lang.Object
  extended by org.apache.hadoop.hbase.io.Cell
All Implemented Interfaces:
Iterable<Map.Entry<Long,byte[]>>, ISerializable, org.apache.hadoop.io.Writable
Direct Known Subclasses:
RestCell

Deprecated. As of hbase 0.20.0, replaced by new Get/Put/Delete/Result-based API.

public class Cell
extends Object
implements org.apache.hadoop.io.Writable, Iterable<Map.Entry<Long,byte[]>>, ISerializable

Cell - Used to transport a cell value (byte[]) and the timestamp it was stored with together as a result for get and getRow methods. This promotes the timestamp of a cell to a first-class value, making it easy to take note of temporal data. Cell is used all the way from HStore up to HTable.


Field Summary
protected  SortedMap<Long,byte[]> valueMap
          Deprecated.  
 
Constructor Summary
Cell()
          Deprecated. For Writable compatibility
Cell(byte[][] vals, long[] ts)
          Deprecated.  
Cell(byte[] value, long timestamp)
          Deprecated. Create a new Cell with a given value and timestamp.
Cell(ByteBuffer bb, long timestamp)
          Deprecated. Create a new Cell with a given value and timestamp.
Cell(String[] vals, long[] ts)
          Deprecated.  
Cell(String value, long timestamp)
          Deprecated. Create a new Cell with a given value and timestamp.
 
Method Summary
 void add(byte[] val, long ts)
          Deprecated. Add a new timestamp and value to this cell provided timestamp does not already exist
static HbaseMapWritable<byte[],Cell> createCells(List<KeyValue> results)
          Deprecated.  
static Cell[] createSingleCellArray(List<KeyValue> results)
          Deprecated.  
 int getNumValues()
          Deprecated.  
 long getTimestamp()
          Deprecated.  
 byte[] getValue()
          Deprecated.  
 Iterator<Map.Entry<Long,byte[]>> iterator()
          Deprecated.  
 void readFields(DataInput in)
          Deprecated.  
 void restSerialize(IRestSerializer serializer)
          Deprecated. visitor pattern method where the object implementing this interface will call back on the IRestSerializer with the correct method to run to serialize the output of the object to the stream.
 String toString()
          Deprecated.  
 void write(DataOutput out)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

valueMap

protected final SortedMap<Long,byte[]> valueMap
Deprecated. 
Constructor Detail

Cell

public Cell()
Deprecated. 
For Writable compatibility


Cell

public Cell(String value,
            long timestamp)
Deprecated. 
Create a new Cell with a given value and timestamp. Used by HStore.

Parameters:
value -
timestamp -

Cell

public Cell(byte[] value,
            long timestamp)
Deprecated. 
Create a new Cell with a given value and timestamp. Used by HStore.

Parameters:
value -
timestamp -

Cell

public Cell(ByteBuffer bb,
            long timestamp)
Deprecated. 
Create a new Cell with a given value and timestamp. Used by HStore.

Parameters:
bb -
timestamp -

Cell

public Cell(String[] vals,
            long[] ts)
Deprecated. 
Parameters:
vals - array of values
ts - array of timestamps

Cell

public Cell(byte[][] vals,
            long[] ts)
Deprecated. 
Parameters:
vals - array of values
ts - array of timestamps
Method Detail

getValue

public byte[] getValue()
Deprecated. 
Returns:
the current cell's value

getTimestamp

public long getTimestamp()
Deprecated. 
Returns:
the current cell's timestamp

getNumValues

public int getNumValues()
Deprecated. 
Returns:
the number of values this cell holds

add

public void add(byte[] val,
                long ts)
Deprecated. 
Add a new timestamp and value to this cell provided timestamp does not already exist

Parameters:
val -
ts -

toString

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

readFields

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

write

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

iterator

public Iterator<Map.Entry<Long,byte[]>> iterator()
Deprecated. 
Specified by:
iterator in interface Iterable<Map.Entry<Long,byte[]>>

createCells

public static HbaseMapWritable<byte[],Cell> createCells(List<KeyValue> results)
Deprecated. 
Parameters:
results -
Returns:
TODO: This is the glue between old way of doing things and the new. Herein we are converting our clean KeyValues to Map of Cells.

createSingleCellArray

public static Cell[] createSingleCellArray(List<KeyValue> results)
Deprecated. 
Parameters:
results -
Returns:
Array of Cells. TODO: This is the glue between old way of doing things and the new. Herein we are converting our clean KeyValues to Map of Cells.

restSerialize

public void restSerialize(IRestSerializer serializer)
                   throws HBaseRestException
Deprecated. 
Description copied from interface: ISerializable
visitor pattern method where the object implementing this interface will call back on the IRestSerializer with the correct method to run to serialize the output of the object to the stream.

Specified by:
restSerialize in interface ISerializable
Throws:
HBaseRestException


Copyright © 2009 The Apache Software Foundation