Package org.apache.hadoop.hbase.types
Class OrderedNumeric
An
Number
of arbitrary precision and variable-length encoding. The resulting length of
encoded values is determined by the numerical (base 100) precision, not absolute value. Use this
data type anywhere you would expect to use a DECIMAL
type, a BigDecimal
, a
BigInteger
, or any time you've parsed floating precision values from text. Built on
OrderedBytes.encodeNumeric(PositionedByteRange, BigDecimal, Order)
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final OrderedNumeric
Deprecated.since 3.0.0 and will be removed in 4.0.0static final OrderedNumeric
Deprecated.since 3.0.0 and will be removed in 4.0.0Fields inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
order
-
Constructor Summary
ConstructorDescriptionOrderedNumeric
(Order order) Creates a newNumber
of arbitrary precision and variable-length encoding. -
Method Summary
Modifier and TypeMethodDescriptionRead an instance ofT
from the buffersrc
.double
Read adouble
value from the buffersrc
.long
Read along
value from the buffersrc
.int
encode
(PositionedByteRange dst, Number val) Write instanceval
into bufferdst
.Inform consumers over what type thisDataType
operates.int
encodedLength
(Number val) Inform consumers how long the encodedbyte[]
will be.int
encodeDouble
(PositionedByteRange dst, double val) Write instanceval
into bufferdst
.int
encodeLong
(PositionedByteRange dst, long val) Write instanceval
into bufferdst
.Methods inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
getOrder, isNullable, isOrderPreserving, isSkippable, skip
-
Field Details
-
ASCENDING
Deprecated.since 3.0.0 and will be removed in 4.0.0 -
DESCENDING
Deprecated.since 3.0.0 and will be removed in 4.0.0
-
-
Constructor Details
-
Method Details
-
encodedLength
Description copied from interface:DataType
Inform consumers how long the encodedbyte[]
will be.- 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. -
decode
Description copied from interface:DataType
Read an instance ofT
from the buffersrc
.- Parameters:
src
- the buffer containing the encoded value.
-
encode
Description copied from interface:DataType
Write instanceval
into bufferdst
.- Parameters:
dst
- the buffer containing the encoded value.val
- the value to encode ontodst
.- Returns:
- number of bytes written.
-
decodeLong
Read along
value from the buffersrc
.- Parameters:
src
- thePositionedByteRange
to read thelong
from- Returns:
- the
long
read from the buffer
-
encodeLong
Write instanceval
into bufferdst
.- Parameters:
dst
- thePositionedByteRange
to write toval
- the value to write todst
- Returns:
- the number of bytes written
-
decodeDouble
Read adouble
value from the buffersrc
.- Parameters:
src
- thePositionedByteRange
to read thedouble
from- Returns:
- the
double
read from the buffer
-
encodeDouble
Write instanceval
into bufferdst
.- Parameters:
dst
- thePositionedByteRange
to write toval
- the value to write todst
- Returns:
- the number of bytes written
-