Package org.apache.hadoop.hbase.types
Class Union2<A,B>
java.lang.Object
org.apache.hadoop.hbase.types.Union2<A,B>
- Direct Known Subclasses:
Union3
The
Union family of DataTypes encode one of a fixed set of Objects. They
provide convenience methods which handle type casting on your behalf.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRead an instance of the first type parameter from buffersrc.Read an instance of the second type parameter from buffersrc.Inform consumers over what type thisDataTypeoperates.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.types.DataType
decode, encode, encodedLength, skip
-
Field Details
-
typeA
-
typeB
-
-
Constructor Details
-
Union2
Create an instance ofUnion2over the set of specified types.
-
-
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<A>- 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<A>- 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<A>
-
encodedClass
Description copied from interface:DataTypeInform consumers over what type thisDataTypeoperates. Useful when working with bareDataTypeinstances.- Specified by:
encodedClassin interfaceDataType<A>
-
decodeA
Read an instance of the first type parameter from buffersrc. -
decodeB
Read an instance of the second type parameter from buffersrc.
-