com.nhncorp.neptune.client
Class Row

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

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

Neptune에 저장되는 하나의 Row를 나타낸다. Column은 테이블 스키마의 Column을 의미하며 저장된 값은 Cell로 표현된다.

Author:
nhn

Nested Class Summary
static class Row.Key
          Row의 Key를 저장하는 클래스
 
Constructor Summary
Row()
          NWritable을 위해 필요한 기본 생성자.
Row(Row.Key key)
           
 
Method Summary
 void addCell(java.lang.String columnName, Cell cell)
          특정 Column에 Cell(값)을 추가한다.
 void addCells(java.lang.String columnName, java.util.List<Cell> paramCells)
          특정 Column에 Cell의 목록을 추가한다.
 int compareTo(Row row)
           
 java.util.Map<java.lang.String,java.util.List<Cell>> getAllCells()
           
 java.util.List<Cell> getCells(java.lang.String columnName)
          조회된 값에서 특정 Column의 Cell 목록을 가져온다.
 java.lang.String[] getColumnNames()
           
 int getColumnSize()
          NTable의 get 연산 또는 Scanner에 의해 전달된 값에서 Column 갯수
 java.util.List<Cell> getFirstColumnCells()
          get, scanner에서 Column 하나만 이용하여 조회한 경우 Cell 값을 가져 온다.
 Row.Key getKey()
          Row의 key를 반환한다.
 Cell getOne(java.lang.String columnName)
          특정 Column의 첫번째 값을 가져온다.
 void print(java.lang.String columnName)
           
 void readFields(java.io.DataInput in)
          Reads the fields of this object from in.
 void setAllCells(java.util.Map<java.lang.String,java.util.List<Cell>> cells)
           
 void setKey(Row.Key key)
           
 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

Row

public Row()
NWritable을 위해 필요한 기본 생성자. 사용할 때는 가능하면 Row(Row.Key key) 생성자를 이용.


Row

public Row(Row.Key key)
Method Detail

getColumnSize

public int getColumnSize()
NTable의 get 연산 또는 Scanner에 의해 전달된 값에서 Column 갯수

Returns:

getKey

public Row.Key getKey()
Row의 key를 반환한다.

Returns:

addCell

public void addCell(java.lang.String columnName,
                    Cell cell)
특정 Column에 Cell(값)을 추가한다.

Parameters:
columnName -
cell -

addCells

public void addCells(java.lang.String columnName,
                     java.util.List<Cell> paramCells)
특정 Column에 Cell의 목록을 추가한다.

Parameters:
columnName -
paramCells -

getCells

public java.util.List<Cell> getCells(java.lang.String columnName)
조회된 값에서 특정 Column의 Cell 목록을 가져온다.

Parameters:
columnName -
Returns:

getOne

public Cell getOne(java.lang.String columnName)
특정 Column의 첫번째 값을 가져온다. 하나의 Row에 Cell이 하나만 있는 경우에 주로 사용

Parameters:
columnName -
Returns:

getFirstColumnCells

public java.util.List<Cell> getFirstColumnCells()
                                         throws java.io.IOException
get, scanner에서 Column 하나만 이용하여 조회한 경우 Cell 값을 가져 온다.

Returns:
Throws:
java.io.IOException

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(Row row)
Specified by:
compareTo in interface java.lang.Comparable<Row>

getAllCells

public java.util.Map<java.lang.String,java.util.List<Cell>> getAllCells()

setAllCells

public void setAllCells(java.util.Map<java.lang.String,java.util.List<Cell>> cells)

setKey

public void setKey(Row.Key key)

getColumnNames

public java.lang.String[] getColumnNames()

print

public void print(java.lang.String columnName)