Class CellModel
java.lang.Object
org.apache.hadoop.hbase.rest.model.CellModel
- All Implemented Interfaces:
Serializable,ProtobufMessageHandler
Representation of a cell. A cell is a single value associated a column and optional qualifier,
and either the timestamp when it was stored or the user- provided timestamp if one was explicitly
supplied.
<complexType name="Cell">
<sequence>
<element name="value" maxOccurs="1" minOccurs="1">
<simpleType>
<restriction base="base64Binary"/>
</simpleType>
</element>
</sequence>
<attribute name="column" type="base64Binary" />
<attribute name="timestamp" type="int" />
</complexType>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]static final intprivate static final longprivate longprivate byte[]private intprivate intFields inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCellModel(byte[] column, byte[] value) ConstructorCellModel(byte[] column, byte[] qualifier, byte[] value) ConstructorCellModel(byte[] family, byte[] qualifier, long timestamp, byte[] value) ConstructorCellModel(byte[] column, long timestamp, byte[] value) ConstructorConstructor from KeyValue This avoids copying the value from the cell, and tries to optimize generating the column value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbyte[]Returns the columngetObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) longReturns the timestampbyte[]getValue()Returns the valuebyte[]Returns the backing array for value (may be the same as value)intintinthashCode()booleanReturns true if the timestamp property has been specified by the userstatic byte[]makeColumn(byte[] family, int familyOffset, int familyLength, byte[] qualifier, int qualifierOffset, int qualifierLength) Makes a column in family:qualifier form from separate byte arrays with offset and length.org.apache.hbase.thirdparty.com.google.protobuf.MessageConvert to model to a protobuf Message objectvoidsetColumn(byte[] column) voidsetTimestamp(long timestamp) voidsetValue(byte[] value) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
createProtobufOutput, getObjectFromMessage, getObjectFromMessage, writeProtobufOutput
-
Field Details
-
serialVersionUID
- See Also:
-
MAGIC_LENGTH
- See Also:
-
column
-
timestamp
-
value
-
valueOffset
-
valueLength
-
-
Constructor Details
-
CellModel
public CellModel()Default constructor -
CellModel
Constructor -
CellModel
Constructor -
CellModel
Constructor from KeyValue This avoids copying the value from the cell, and tries to optimize generating the column value. -
CellModel
Constructor -
CellModel
Constructor
-
-
Method Details
-
getColumn
Returns the column -
setColumn
- Parameters:
column- the column to set
-
hasUserTimestamp
Returns true if the timestamp property has been specified by the user -
getTimestamp
Returns the timestamp -
setTimestamp
- Parameters:
timestamp- the timestamp to set
-
getValue
Returns the value -
getValueArray
Returns the backing array for value (may be the same as value) -
setValue
- Parameters:
value- the value to set
-
getValueOffset
-
getValueLength
-
messageFromObject
Description copied from interface:ProtobufMessageHandlerConvert to model to a protobuf Message object- Specified by:
messageFromObjectin interfaceProtobufMessageHandler- Returns:
- the protobuf Message object
-
getObjectFromMessage
public ProtobufMessageHandler getObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) throws IOException - Specified by:
getObjectFromMessagein interfaceProtobufMessageHandler- Throws:
IOException
-
makeColumn
public static byte[] makeColumn(byte[] family, int familyOffset, int familyLength, byte[] qualifier, int qualifierOffset, int qualifierLength) Makes a column in family:qualifier form from separate byte arrays with offset and length.Not recommended for usage as this is old-style API.
- Returns:
- family:qualifier
-
equals
-
hashCode
-
toString
-