Package org.apache.hadoop.hbase.types
This package provides the definition and implementation of HBase's
extensible data type API. DataType
is the entry point. Basic type implementations are provided based on two
different encoding schemes: the Raw*
implementations use the
toXXX
methods in Bytes
and
the Ordered*
implementations use the encoding scheme defined in
OrderedBytes
. Complex types are also
supported in the form of Struct
and
the abstract Union
classes.
DataType
implementations are used to
convert a POJO into a byte[]
while maintaining application-level
constraints over the values produces and consumed. They also provide hints
to consumers about the nature of encoded values as well as the relationship
between different instances. See the class comments on
DataType
for details.
The DataType
interface is primarily
of use for creating rowkeys and column qualifiers. It can also be used as a
an encoder for primitive values. It does not support concerns of complex
object serialization, concepts like schema version and migration. These
concepts are handled more thoroughly by tools like Thrift, Avro, and
Protobuf.
- Since:
- 0.95.2
-
ClassDescriptionCopyOnWriteArrayMap<K,
V> A Map that keeps a sorted array in order to provide the concurrent map interface.DataType<T>DataType
is the base class for all HBase data types.Wraps an existingDataType
implementation as a fixed-length version of itself.Abyte[]
of variable-length.An alternative toOrderedBlob
for use byStruct
fields that do not terminate the fields list.Base class for data types backed by theOrderedBytes
encoding implementations.Afloat
of 32-bits using a fixed-length encoding.Adouble
of 64-bits using a fixed-length encoding.Ashort
of 16-bits using a fixed-length encoding.Anint
of 32-bits using a fixed-length encoding.Along
of 64-bits using a fixed-length encoding.Abyte
of 8-bits using a fixed-length encoding.AnNumber
of arbitrary precision and variable-length encoding.AString
of variable-length.An example for using protobuf objects withDataType
API.PBType<T extends org.apache.hbase.thirdparty.com.google.protobuf.Message>A base-class forDataType
implementations backed by protobuf.AnDataType
for interacting with values encoded usingBytes.putByte(byte[], int, byte)
.AnDataType
for interacting with variable-length values encoded usingBytes.putBytes(byte[], int, byte[], int, int)
.AnDataType
that encodes fixed-length values encoded usingBytes.putBytes(byte[], int, byte[], int, int)
.AnDataType
that encodes variable-length values encoded usingBytes.putBytes(byte[], int, byte[], int, int)
.AnDataType
for interacting with values encoded usingBytes.putDouble(byte[], int, double)
.AnDataType
for interacting with values encoded usingBytes.putFloat(byte[], int, float)
.AnDataType
for interacting with values encoded usingBytes.putInt(byte[], int, int)
.AnDataType
for interacting with values encoded usingBytes.putLong(byte[], int, long)
.AnDataType
for interacting with values encoded usingBytes.putShort(byte[], int, short)
.AnDataType
for interacting with values encoded usingBytes.toBytes(String)
.AnDataType
that encodes fixed-length values encoded usingBytes.toBytes(String)
.AnDataType
that encodes variable-length values encoded usingBytes.toBytes(String)
.Struct
is a simpleDataType
for implementing "compound rowkey" and "compound qualifier" schema design strategies.A helper for buildingStruct
instances.AnIterator
over encodedStruct
members.Wraps an existingDataType
implementation as a terminated version of itself.Union2<A,B> Union3<A,B, C> TheUnion
family ofDataType
s encode one of a fixed collection of Objects.Union4<A,B, C, D> TheUnion
family ofDataType
s encode one of a fixed collection of Objects.