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
Modifier and TypeFieldDescriptionprivate byte[]
static final int
private static final long
private long
private byte[]
private int
private int
Fields inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
BUFFER_SIZE
-
Constructor Summary
ConstructorDescriptionDefault 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 TypeMethodDescriptionboolean
byte[]
Returns the columngetObjectFromMessage
(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) long
Returns the timestampbyte[]
getValue()
Returns the valuebyte[]
Returns the backing array for value (may be the same as value)int
int
int
hashCode()
boolean
Returns 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.Message
Convert to model to a protobuf Message objectvoid
setColumn
(byte[] column) void
setTimestamp
(long timestamp) void
setValue
(byte[] value) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:ProtobufMessageHandler
Convert to model to a protobuf Message object- Specified by:
messageFromObject
in interfaceProtobufMessageHandler
- Returns:
- the protobuf Message object
-
getObjectFromMessage
public ProtobufMessageHandler getObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) throws IOException - Specified by:
getObjectFromMessage
in 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
-