org.apache.hadoop.hbase.io
Class Cell
java.lang.Object
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.
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. |
values
protected byte[][] values
timestamps
protected long[] timestamps
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 valuests
- array of timestamps
Cell
public Cell(byte[][] vals,
long[] ts)
- Parameters:
vals
- array of valuests
- array of timestamps
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