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
FieldsFields inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
order -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRead an instance ofTfrom the buffersrc.doubleRead adoublevalue from the buffersrc.longRead alongvalue from the buffersrc.intencode(PositionedByteRange dst, Number val) Write instancevalinto bufferdst.Inform consumers over what type thisDataTypeoperates.intencodedLength(Number val) Inform consumers how long the encodedbyte[]will be.intencodeDouble(PositionedByteRange dst, double val) Write instancevalinto bufferdst.intencodeLong(PositionedByteRange dst, long val) Write instancevalinto bufferdst.Methods inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
getOrder, isNullable, isOrderPreserving, isSkippable, skip
-
Field Details
-
ASCENDING
-
DESCENDING
-
-
Constructor Details
-
OrderedNumeric
-
-
Method Details
-
encodedLength
Description copied from interface:DataTypeInform 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:DataTypeInform consumers over what type thisDataTypeoperates. Useful when working with bareDataTypeinstances. -
decode
Description copied from interface:DataTypeRead an instance ofTfrom the buffersrc.- Parameters:
src- the buffer containing the encoded value.
-
encode
Description copied from interface:DataTypeWrite instancevalinto bufferdst.- Parameters:
dst- the buffer containing the encoded value.val- the value to encode ontodst.- Returns:
- number of bytes written.
-
decodeLong
Read alongvalue from the buffersrc. -
encodeLong
Write instancevalinto bufferdst. -
decodeDouble
Read adoublevalue from the buffersrc. -
encodeDouble
Write instancevalinto bufferdst.
-