Package org.apache.hadoop.hbase.types
Class RawBytesTerminated
java.lang.Object
org.apache.hadoop.hbase.types.TerminatedWrapper<byte[]>
org.apache.hadoop.hbase.types.RawBytesTerminated
- All Implemented Interfaces:
DataType<byte[]>
An
DataType
that encodes variable-length values encoded using
Bytes.putBytes(byte[], int, byte[], int, int)
. Includes a
termination marker following the raw byte[]
value. Intended to make it easier to
transition away from direct use of Bytes
.-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.types.TerminatedWrapper
term, wrapped
-
Constructor Summary
ConstructorDescriptionRawBytesTerminated
(byte[] term) Create aRawBytesTerminated
using the specified terminator.RawBytesTerminated
(String term) Create aRawBytesTerminated
using the specified terminator.RawBytesTerminated
(Order order, byte[] term) Create aRawBytesTerminated
using the specified terminator andorder
.RawBytesTerminated
(Order order, String term) Create aRawBytesTerminated
using the specified terminator andorder
. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decode
(PositionedByteRange src, int length) Read abyte[]
from the buffersrc
.int
encode
(PositionedByteRange dst, byte[] val, int voff, int vlen) Writeval
intodst
, respectingoffset
andlength
.Methods inherited from class org.apache.hadoop.hbase.types.TerminatedWrapper
decode, encode, encodedClass, encodedLength, getOrder, isNullable, isOrderPreserving, isSkippable, skip, terminatorPosition
-
Constructor Details
-
RawBytesTerminated
Create aRawBytesTerminated
using the specified terminator andorder
.- Throws:
IllegalArgumentException
- ifterm
isnull
or empty.
-
RawBytesTerminated
Create aRawBytesTerminated
using the specified terminator andorder
.- Throws:
IllegalArgumentException
- ifterm
isnull
or empty.
-
RawBytesTerminated
Create aRawBytesTerminated
using the specified terminator.- Throws:
IllegalArgumentException
- ifterm
isnull
or empty.
-
RawBytesTerminated
Create aRawBytesTerminated
using the specified terminator.- Throws:
IllegalArgumentException
- ifterm
isnull
or empty.
-
-
Method Details
-
decode
Read abyte[]
from the buffersrc
. -
encode
Writeval
intodst
, respectingoffset
andlength
.- Returns:
- number of bytes written.
-