Class BinaryRawValueData<T>
- java.lang.Object
-
- org.apache.flink.table.data.binary.LazyBinaryFormat<T>
-
- org.apache.flink.table.data.binary.BinaryRawValueData<T>
-
- Type Parameters:
T
- the java type of the raw value.
- All Implemented Interfaces:
BinaryFormat
,RawValueData<T>
@Internal public final class BinaryRawValueData<T> extends LazyBinaryFormat<T> implements RawValueData<T>
A lazily binary implementation ofRawValueData
which is backed byMemorySegment
s and genericObject
.Either
MemorySegment
s orObject
must be provided when constructingBinaryRawValueData
. The other representation will be materialized when needed.
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.table.data.binary.BinaryFormat
HIGHEST_FIRST_BIT, HIGHEST_SECOND_TO_EIGHTH_BIT, MAX_FIX_PART_DATA_SIZE
-
-
Constructor Summary
Constructors Constructor Description BinaryRawValueData(MemorySegment[] segments, int offset, int sizeInBytes)
BinaryRawValueData(MemorySegment[] segments, int offset, int sizeInBytes, T javaObject)
BinaryRawValueData(T javaObject)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static <T> BinaryRawValueData<T>
fromBytes(byte[] bytes)
Creates aBinaryStringData
instance from the given bytes.static <T> BinaryRawValueData<T>
fromBytes(byte[] bytes, int offset, int numBytes)
Creates aBinaryStringData
instance from the given bytes with offset and number of bytes.static <T> BinaryRawValueData<T>
fromObject(T javaObject)
Creates aBinaryRawValueData
instance from the given Java object.int
hashCode()
protected BinarySection
materialize(TypeSerializer<T> serializer)
Materialize java object to binary format.byte[]
toBytes(TypeSerializer<T> serializer)
Converts thisRawValueData
into a byte array.T
toObject(TypeSerializer<T> serializer)
Converts thisRawValueData
into a Java object.String
toString()
-
Methods inherited from class org.apache.flink.table.data.binary.LazyBinaryFormat
ensureMaterialized, getBinarySection, getJavaObject, getOffset, getSegments, getSizeInBytes, setJavaObject
-
-
-
-
Constructor Detail
-
BinaryRawValueData
public BinaryRawValueData(T javaObject)
-
BinaryRawValueData
public BinaryRawValueData(MemorySegment[] segments, int offset, int sizeInBytes)
-
BinaryRawValueData
public BinaryRawValueData(MemorySegment[] segments, int offset, int sizeInBytes, T javaObject)
-
-
Method Detail
-
toObject
public T toObject(TypeSerializer<T> serializer)
Description copied from interface:RawValueData
Converts thisRawValueData
into a Java object.The given serializer is required because the "raw value" might be represented in a binary format and needs to be deserialized first.
Note: The returned Java object may be reused.
- Specified by:
toObject
in interfaceRawValueData<T>
-
toBytes
public byte[] toBytes(TypeSerializer<T> serializer)
Description copied from interface:RawValueData
Converts thisRawValueData
into a byte array.The given serializer is required because the "raw value" might be still be a Java object and needs to be serialized first.
Note: The returned byte array may be reused.
- Specified by:
toBytes
in interfaceRawValueData<T>
-
materialize
protected BinarySection materialize(TypeSerializer<T> serializer)
Description copied from class:LazyBinaryFormat
Materialize java object to binary format. Inherited classes need to hold the information they need. (For example,RawValueData
needs javaObjectSerializer).- Specified by:
materialize
in classLazyBinaryFormat<T>
-
fromObject
public static <T> BinaryRawValueData<T> fromObject(T javaObject)
Creates aBinaryRawValueData
instance from the given Java object.
-
fromBytes
public static <T> BinaryRawValueData<T> fromBytes(byte[] bytes)
Creates aBinaryStringData
instance from the given bytes.
-
fromBytes
public static <T> BinaryRawValueData<T> fromBytes(byte[] bytes, int offset, int numBytes)
Creates aBinaryStringData
instance from the given bytes with offset and number of bytes.
-
-