Package org.apache.hadoop.hbase.types
Class RawString
java.lang.Object
org.apache.hadoop.hbase.types.RawString
An
DataType for interacting with values encoded using Bytes.toBytes(String).
Intended to make it easier to transition away from direct use of Bytes.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.since 3.0.0 and will be removed in 4.0.0Creates a newDataTypefor interacting with values encoded usingBytes.toBytes(String). -
Method Summary
Modifier and TypeMethodDescriptionRead an instance ofTfrom the buffersrc.intencode(PositionedByteRange dst, String val) Write instancevalinto bufferdst.Inform consumers over what type thisDataTypeoperates.intencodedLength(String val) Inform consumers how long the encodedbyte[]will be.getOrder()Retrieve the sortOrderimposed by this data type, or null when natural ordering is not preserved.booleanIndicates whether this instance supports encoding null values.booleanIndicates whether this instance writes encodedbyte[]'s which preserve the natural sort order of the unencoded value.booleanIndicates whether this instance is able to skip over it's encoded value.intskip(PositionedByteRange src) Skipsrc's position forward over one encoded value.
-
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 -
order
-
-
Constructor Details
-
RawString
Deprecated.since 3.0.0 and will be removed in 4.0.0 -
RawString
Creates a newDataTypefor interacting with values encoded usingBytes.toBytes(String).- Parameters:
order- theOrderto use
-
-
Method Details
-
isOrderPreserving
Description copied from interface:DataTypeIndicates whether this instance writes encodedbyte[]'s which preserve the natural sort order of the unencoded value.- Specified by:
isOrderPreservingin interfaceDataType<String>- Returns:
truewhen natural order is preserved,falseotherwise.
-
getOrder
Description copied from interface:DataTypeRetrieve the sortOrderimposed 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:DataTypeIndicates whether this instance supports encoding null values. This depends on the implementation details of the encoding format. AllDataTypes that support null should treat null as comparing less than any non-null value for default sort ordering purposes.- Specified by:
isNullablein interfaceDataType<String>- Returns:
truewhen null is supported,falseotherwise.
-
isSkippable
Description copied from interface:DataTypeIndicates whether this instance is able to skip over it's encoded value.DataTypes that are not skippable can only be used as the right-most field of aStruct.- Specified by:
isSkippablein interfaceDataType<String>
-
skip
Description copied from interface:DataTypeSkipsrc's position forward over one encoded value. -
encodedLength
Description copied from interface:DataTypeInform consumers how long the encodedbyte[]will be.- Specified by:
encodedLengthin interfaceDataType<String>- 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.- Specified by:
encodedClassin interfaceDataType<String>
-
decode
Description copied from interface:DataTypeRead an instance ofTfrom the buffersrc. -
encode
Description copied from interface:DataTypeWrite instancevalinto bufferdst.
-