com.nhncorp.neptune.client
Class Cell

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

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

하나의 Row의 특정 Column에 저장된 값을 표현한다. Neptune의 데이터모델은 Row-Column이 교차하는 지점에 n개의 데이터를 저장할 수 있으며 각 데이터는 Cell.Key로 구분된다. 동일한 Cell내에는 서로다른 버전(timestamp)의 값이 여러개 존재할 수 있으며 Cell.Value로 실제 저장된 값이 표현된다.

Author:
nhn

Nested Class Summary
static class Cell.Key
          Cell의 Key를 저장하는 클래스
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)
          값을 추가한다.
 int compareTo(Cell o)
           
 byte[] getBytes()
          최근 버전 Value의 값을 반환한다.
 Cell.Key getKey()
           
 java.lang.String getPrintValue()
           
 java.lang.String getPrintValue(java.lang.String encoding)
           
 Cell.Value getValue()
          최근 버전의 Value를 반환한다.
 Cell.Value getValue(int index)
          여러 버전의 값이 있는 경우 index를 이용하여 Value 값을 가져온다.
 java.util.List<Cell.Value> getValues()
           
 int getValueSize()
          Value의 갯수를 반환한다.
 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
equals, 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)
값을 추가한다.

Parameters:
value -

getKey

public Cell.Key getKey()

setKey

public void setKey(Cell.Key key)

getBytes

public byte[] getBytes()
최근 버전 Value의 값을 반환한다.

Returns:

getValue

public Cell.Value getValue()
최근 버전의 Value를 반환한다.

Returns:

getValue

public Cell.Value getValue(int index)
여러 버전의 값이 있는 경우 index를 이용하여 Value 값을 가져온다. timestamp로 desc 순서로 저장되어 있다.

Parameters:
index -
Returns:

getValueSize

public int getValueSize()
Value의 갯수를 반환한다. 반환된 값이 버전의 갯수는 아니다. 검색 조건에 의해 다른 Value 개수가 반환된다.

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: 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 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: NWritable
Writes the fields of this object to out.

Specified by:
write in interface 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>