com.nhncorp.neptune.client
Class Cell

java.lang.Object
  extended by com.nhncorp.neptune.client.Cell
All Implemented Interfaces:
com.nhncorp.neptune.common.io.NWritable, java.lang.Comparable<Cell>, org.apache.hadoop.io.Writable

public class Cell
extends java.lang.Object
implements com.nhncorp.neptune.common.io.NWritable, org.apache.hadoop.io.Writable, java.lang.Comparable<Cell>

Neptune stores multiple values in a point of Row-Column.
Cell is Value Object which is stored that point. Cell is identified by Cell.Key in a Row.
A Cell has also multiple Cell.Value objects. Cell.Value is identified by timestamp.


Nested Class Summary
static class Cell.Key
          Cell.Key class
static class Cell.Value
          Cell내에 저장되어 있는 실제 값.
 
Constructor Summary
Cell()
           
Cell(Cell.Key key)
           
Cell(Cell.Key key, byte[] bytes)
           
Cell(Cell.Key key, byte[] bytes, long timestamp)
           
 
Method Summary
 void addValue(Cell.Value value)
          Add Cell.Value
 int compareTo(Cell o)
           
 boolean equals(java.lang.Object obj)
           
 byte[] getBytes()
          Return latest Cell.Value's bytes array
 Cell.Key getKey()
           
 java.lang.String getPrintValue()
           
 java.lang.String getPrintValue(java.lang.String encoding)
           
 Cell.Value getValue()
          Return latest Cell.Value
 Cell.Value getValue(int index)
          Return Cell.Value
Cell.Value is sorted by timestamp descending
 java.lang.String getValueAsString()
          Return (latest Cell.Value's bytes array).toString()
 java.util.List<Cell.Value> getValues()
           
 int getValueSize()
          Return number of Cell.Value
This value is not number of version in a Table, but number of Value which is matched with search condition.
 void readFields(java.io.DataInput in)
          Reads the fields of this object from in.
 void setKey(Cell.Key key)
           
 void setValues(java.util.List<Cell.Value> values)
           
 void write(java.io.DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cell

public Cell()

Cell

public Cell(Cell.Key key)

Cell

public Cell(Cell.Key key,
            byte[] bytes)

Cell

public Cell(Cell.Key key,
            byte[] bytes,
            long timestamp)
Method Detail

addValue

public void addValue(Cell.Value value)
Add Cell.Value

Parameters:
value -

getKey

public Cell.Key getKey()

setKey

public void setKey(Cell.Key key)

getBytes

public byte[] getBytes()
Return latest Cell.Value's bytes array

Returns:

getValueAsString

public java.lang.String getValueAsString()
Return (latest Cell.Value's bytes array).toString()

Returns:

getValue

public Cell.Value getValue()
Return latest Cell.Value

Returns:

getValue

public Cell.Value getValue(int index)
Return Cell.Value
Cell.Value is sorted by timestamp descending

Parameters:
index -
Returns:

getValueSize

public int getValueSize()
Return number of Cell.Value
This value is not number of version in a Table, but number of Value which is matched with search condition.

Returns:

getValues

public java.util.List<Cell.Value> getValues()

setValues

public void setValues(java.util.List<Cell.Value> values)

getPrintValue

public java.lang.String getPrintValue(java.lang.String encoding)

getPrintValue

public java.lang.String getPrintValue()

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Description copied from interface: com.nhncorp.neptune.common.io.NWritable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface com.nhncorp.neptune.common.io.NWritable
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Description copied from interface: com.nhncorp.neptune.common.io.NWritable
Writes the fields of this object to out.

Specified by:
write in interface com.nhncorp.neptune.common.io.NWritable
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

compareTo

public int compareTo(Cell o)
Specified by:
compareTo in interface java.lang.Comparable<Cell>

equals

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