Package org.apache.hadoop.hbase.types
Class RawByte
java.lang.Object
org.apache.hadoop.hbase.types.RawByte
An
DataType
for interacting with values encoded using
Bytes.putByte(byte[], int, byte)
. Intended to make it easier to transition away from
direct use of Bytes
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRead an instance ofT
from the buffersrc
.byte
decodeByte
(byte[] buff, int offset) Read abyte
value from the bufferbuff
.int
encode
(PositionedByteRange dst, Byte val) Write instanceval
into bufferdst
.int
encodeByte
(byte[] buff, int offset, byte val) Write instanceval
into bufferbuff
.Inform consumers over what type thisDataType
operates.int
encodedLength
(Byte val) Inform consumers how long the encodedbyte[]
will be.getOrder()
Retrieve the sortOrder
imposed by this data type, or null when natural ordering is not preserved.boolean
Indicates whether this instance supports encoding null values.boolean
Indicates whether this instance writes encodedbyte[]
's which preserve the natural sort order of the unencoded value.boolean
Indicates whether this instance is able to skip over it's encoded value.int
skip
(PositionedByteRange src) Skipsrc
's position forward over one encoded value.
-
Constructor Details
-
RawByte
public RawByte()
-
-
Method Details
-
isOrderPreserving
Description copied from interface:DataType
Indicates whether this instance writes encodedbyte[]
's which preserve the natural sort order of the unencoded value.- Specified by:
isOrderPreserving
in interfaceDataType<Byte>
- Returns:
true
when natural order is preserved,false
otherwise.
-
getOrder
Description copied from interface:DataType
Retrieve the sortOrder
imposed by this data type, or null when natural ordering is not preserved. Value is either ascending or descending. Default is assumed to beOrder.ASCENDING
. -
isNullable
Description copied from interface:DataType
Indicates whether this instance supports encoding null values. This depends on the implementation details of the encoding format. AllDataType
s that support null should treat null as comparing less than any non-null value for default sort ordering purposes.- Specified by:
isNullable
in interfaceDataType<Byte>
- Returns:
true
when null is supported,false
otherwise.
-
isSkippable
Description copied from interface:DataType
Indicates whether this instance is able to skip over it's encoded value.DataType
s that are not skippable can only be used as the right-most field of aStruct
.- Specified by:
isSkippable
in interfaceDataType<Byte>
-
encodedLength
Description copied from interface:DataType
Inform consumers how long the encodedbyte[]
will be.- Specified by:
encodedLength
in interfaceDataType<Byte>
- Parameters:
val
- The value to check.- Returns:
- the number of bytes required to encode
val
.a
-
encodedClass
Description copied from interface:DataType
Inform consumers over what type thisDataType
operates. Useful when working with bareDataType
instances.- Specified by:
encodedClass
in interfaceDataType<Byte>
-
skip
Description copied from interface:DataType
Skipsrc
's position forward over one encoded value. -
decode
Description copied from interface:DataType
Read an instance ofT
from the buffersrc
. -
encode
Description copied from interface:DataType
Write instanceval
into bufferdst
. -
decodeByte
Read abyte
value from the bufferbuff
. -
encodeByte
Write instanceval
into bufferbuff
.
-