org.apache.hadoop.hbase.io
Class Cell

java.lang.Object
  extended by org.apache.hadoop.hbase.io.Cell
All Implemented Interfaces:
Iterable<Cell>, org.apache.hadoop.io.Writable

public class Cell
extends Object
implements org.apache.hadoop.io.Writable, Iterable<Cell>

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  long[] timestamps
           
protected  byte[][] values
           
 
Constructor Summary
Cell()
          For Writable compatibility
Cell(byte[][] vals, long[] ts)
           
Cell(byte[] value, long timestamp)
          Create a new Cell with a given value and timestamp.
Cell(String[] vals, long[] ts)
           
Cell(String value, long timestamp)
          Create a new Cell with a given value and timestamp.
 
Method Summary
 long getTimestamp()
           
 byte[] getValue()
           
 Iterator<Cell> iterator()
           
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

values

protected byte[][] values

timestamps

protected long[] timestamps
Constructor Detail

Cell

public Cell()
For Writable compatibility


Cell

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

Parameters:
value -
timestamp -

Cell

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

Parameters:
value -
timestamp -

Cell

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

Cell

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

getValue

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

getTimestamp

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

toString

public String toString()
Overrides:
toString in class Object

readFields

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

write

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

iterator

public Iterator<Cell> iterator()
Specified by:
iterator in interface Iterable<Cell>


Copyright © 2008 The Apache Software Foundation