com.nhncorp.neptune.tablet
Class ColumnValue

java.lang.Object
  extended by com.nhncorp.neptune.tablet.ColumnValue
All Implemented Interfaces:
NWritable, java.lang.Comparable<ColumnValue>, org.apache.hadoop.io.Writable
Direct Known Subclasses:
MapFileColumnValue

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

컬럼의 Cell에 저장되는 데이터(ValueObject)
클라이언트 API와 Tablet Server 간에 데이터 전송을 위해 사용된다.

Author:
김형준

Field Summary
static int ARRAY_CLASS_LENGTH
           
static java.lang.String ARRAY_CLASS_NAME
           
static org.apache.commons.logging.Log LOG
           
static long NANO_TIME
           
 
Constructor Summary
ColumnValue()
           
ColumnValue(Row.Key rowKey, Cell.Key cellKey, byte[] value)
           
ColumnValue(Row.Key rowKey, Cell.Key cellKey, byte[] value, boolean deleted)
           
ColumnValue(Row.Key rowKey, Cell.Key cellKey, byte[] value, boolean deleted, long timestamp)
           
ColumnValue(Row.Key rowKey, Cell.Key cellKey, byte[] value, long timestamp)
           
 
Method Summary
 int compareTo(ColumnValue obj)
          주의사항: 동일한 columnKey내에서는 time으로 desc으로 정렬되도록 한다.
 ColumnValue copyColumnValue()
           
 Cell.Value copyToCellValue()
           
 ScanCell copyToScanCell(java.lang.String columnName)
           
 boolean equals(java.lang.Object obj)
           
 boolean equalsKey(ColumnValue columnValue)
           
 int getAllocatedSize()
           
 Cell.Key getCellKey()
           
 int getNumOfValues()
           
 java.lang.String getPrintValue()
           
 java.lang.String getPrintValue(java.lang.String encoding)
           
 Row.Key getRowKey()
           
 long getTimestamp()
           
 byte[] getValue()
           
 NWritable getValue(NWritable writable)
           
 int getValueAsInt()
           
 long getValueAsLong()
           
 java.lang.String getValueAsString()
           
 boolean isDeleted()
           
 void readFields(java.io.DataInput in)
          Reads the fields of this object from in.
 void setCellKey(Cell.Key cellKey)
           
 void setDeleted(boolean deleted)
           
 void setNumOfValues(int numOfValues)
           
 void setRowKey(Row.Key rowKey)
           
 void setTimestamp(long timestamp)
           
 void setValue(byte[] value)
           
 int size()
           
 java.lang.String toString()
           
 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, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

ARRAY_CLASS_NAME

public static final java.lang.String ARRAY_CLASS_NAME

ARRAY_CLASS_LENGTH

public static final int ARRAY_CLASS_LENGTH

NANO_TIME

public static long NANO_TIME
Constructor Detail

ColumnValue

public ColumnValue()

ColumnValue

public ColumnValue(Row.Key rowKey,
                   Cell.Key cellKey,
                   byte[] value)

ColumnValue

public ColumnValue(Row.Key rowKey,
                   Cell.Key cellKey,
                   byte[] value,
                   boolean deleted)

ColumnValue

public ColumnValue(Row.Key rowKey,
                   Cell.Key cellKey,
                   byte[] value,
                   long timestamp)

ColumnValue

public ColumnValue(Row.Key rowKey,
                   Cell.Key cellKey,
                   byte[] value,
                   boolean deleted,
                   long timestamp)
Method Detail

copyColumnValue

public ColumnValue copyColumnValue()

isDeleted

public boolean isDeleted()

setDeleted

public void setDeleted(boolean deleted)

getRowKey

public Row.Key getRowKey()

setRowKey

public void setRowKey(Row.Key rowKey)

getCellKey

public Cell.Key getCellKey()

setCellKey

public void setCellKey(Cell.Key cellKey)

getValue

public byte[] getValue()

setValue

public void setValue(byte[] value)

getValueAsString

public java.lang.String getValueAsString()

getValue

public NWritable getValue(NWritable writable)
                   throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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

size

public int size()
         throws java.io.IOException
Throws:
java.io.IOException

getAllocatedSize

public int getAllocatedSize()

compareTo

public int compareTo(ColumnValue obj)
주의사항: 동일한 columnKey내에서는 time으로 desc으로 정렬되도록 한다.(최근 데이터가 가장 위에 올라온다)

Specified by:
compareTo in interface java.lang.Comparable<ColumnValue>

equals

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

getTimestamp

public long getTimestamp()

setTimestamp

public void setTimestamp(long timestamp)

getPrintValue

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

getPrintValue

public java.lang.String getPrintValue()

equalsKey

public boolean equalsKey(ColumnValue columnValue)

getNumOfValues

public int getNumOfValues()

setNumOfValues

public void setNumOfValues(int numOfValues)

getValueAsLong

public long getValueAsLong()

getValueAsInt

public int getValueAsInt()

copyToCellValue

public Cell.Value copyToCellValue()

copyToScanCell

public ScanCell copyToScanCell(java.lang.String columnName)