Package org.apache.hadoop.hbase.types
Class PBType<T extends com.google.protobuf.Message>
java.lang.Object
org.apache.hadoop.hbase.types.PBType<T>
- All Implemented Interfaces:
DataType<T>
- Direct Known Subclasses:
PBCell
@Deprecated
@Public
public abstract class PBType<T extends com.google.protobuf.Message>
extends Object
implements DataType<T>
Deprecated.
Will be removed in 3.0.0 without replacement. It should not be a public API as it
exposes the protobuf stuff. Users who depend on this class should just copy the code
your own code base.
A base-class for
DataType
implementations backed by protobuf. See PBKeyValue
in
hbase-examples
module.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
encodedLength
(T val) Deprecated.Inform consumers how long the encodedbyte[]
will be.getOrder()
Deprecated.Retrieve the sortOrder
imposed by this data type, or null when natural ordering is not preserved.static com.google.protobuf.CodedInputStream
Deprecated.Create aCodedInputStream
from aPositionedByteRange
.boolean
Deprecated.Indicates whether this instance supports encoding null values.boolean
Deprecated.Indicates whether this instance writes encodedbyte[]
's which preserve the natural sort order of the unencoded value.boolean
Deprecated.Indicates whether this instance is able to skip over it's encoded value.static com.google.protobuf.CodedOutputStream
Deprecated.Create aCodedOutputStream
from aPositionedByteRange
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.types.DataType
decode, encode, encodedClass, skip
-
Constructor Details
-
PBType
public PBType()Deprecated.
-
-
Method Details
-
isOrderPreserving
Deprecated.Description copied from interface:DataType
Indicates whether this instance writes encodedbyte[]
's which preserve the natural sort order of the unencoded value.- Specified by:
isOrderPreserving
in interfaceDataType<T extends com.google.protobuf.Message>
- Returns:
true
when natural order is preserved,false
otherwise.
-
getOrder
Deprecated.Description copied from interface:DataType
Retrieve the sortOrder
imposed 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
Deprecated.Description copied from interface:DataType
Indicates whether this instance supports encoding null values. This depends on the implementation details of the encoding format. AllDataType
s that support null should treat null as comparing less than any non-null value for default sort ordering purposes.- Specified by:
isNullable
in interfaceDataType<T extends com.google.protobuf.Message>
- Returns:
true
when null is supported,false
otherwise.
-
isSkippable
Deprecated.Description copied from interface:DataType
Indicates whether this instance is able to skip over it's encoded value.DataType
s that are not skippable can only be used as the right-most field of aStruct
.- Specified by:
isSkippable
in interfaceDataType<T extends com.google.protobuf.Message>
-
encodedLength
Deprecated.Description copied from interface:DataType
Inform consumers how long the encodedbyte[]
will be.- Specified by:
encodedLength
in interfaceDataType<T extends com.google.protobuf.Message>
- Parameters:
val
- The value to check.- Returns:
- the number of bytes required to encode
val
.a
-
inputStreamFromByteRange
public static com.google.protobuf.CodedInputStream inputStreamFromByteRange(PositionedByteRange src) Deprecated.Create aCodedInputStream
from aPositionedByteRange
. Be sure to updatesrc
's position after consuming from the stream.For example:
Foo.Builder builder = ... CodedInputStream is = inputStreamFromByteRange(src); Foo ret = builder.mergeFrom(is).build(); src.setPosition(src.getPosition() + is.getTotalBytesRead());
-
outputStreamFromByteRange
public static com.google.protobuf.CodedOutputStream outputStreamFromByteRange(PositionedByteRange dst) Deprecated.Create aCodedOutputStream
from aPositionedByteRange
. Be sure to updatedst
's position after writing to the stream.For example:
CodedOutputStream os = outputStreamFromByteRange(dst); int before = os.spaceLeft(), after, written; val.writeTo(os); after = os.spaceLeft(); written = before - after; dst.setPosition(dst.getPosition() + written);
-