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 of
RawValueData which is backed by MemorySegments
and generic Object.
Either MemorySegments or Object must be provided when constructing BinaryRawValueData. 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
ConstructorsConstructorDescriptionBinaryRawValueData(org.apache.flink.core.memory.MemorySegment[] segments, int offset, int sizeInBytes) BinaryRawValueData(org.apache.flink.core.memory.MemorySegment[] segments, int offset, int sizeInBytes, T javaObject) BinaryRawValueData(T javaObject) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic <T> BinaryRawValueData<T>fromBytes(byte[] bytes) Creates aBinaryStringDatainstance from the given bytes.static <T> BinaryRawValueData<T>fromBytes(byte[] bytes, int offset, int numBytes) Creates aBinaryStringDatainstance from the given bytes with offset and number of bytes.static <T> BinaryRawValueData<T>fromObject(T javaObject) Creates aBinaryRawValueDatainstance from the given Java object.inthashCode()protected BinarySectionmaterialize(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer) Materialize java object to binary format.byte[]Converts thisRawValueDatainto a byte array.Converts thisRawValueDatainto a Java object.toString()Methods inherited from class org.apache.flink.table.data.binary.LazyBinaryFormat
ensureMaterialized, getBinarySection, getJavaObject, getOffset, getSegments, getSizeInBytes, setJavaObject
-
Constructor Details
-
BinaryRawValueData
-
BinaryRawValueData
public BinaryRawValueData(org.apache.flink.core.memory.MemorySegment[] segments, int offset, int sizeInBytes) -
BinaryRawValueData
public BinaryRawValueData(org.apache.flink.core.memory.MemorySegment[] segments, int offset, int sizeInBytes, T javaObject)
-
-
Method Details
-
toObject
Description copied from interface:RawValueDataConverts thisRawValueDatainto 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:
toObjectin interfaceRawValueData<T>
-
toBytes
Description copied from interface:RawValueDataConverts thisRawValueDatainto 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:
toBytesin interfaceRawValueData<T>
-
equals
-
hashCode
public int hashCode() -
toString
-
materialize
protected BinarySection materialize(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer) Description copied from class:LazyBinaryFormatMaterialize java object to binary format. Inherited classes need to hold the information they need. (For example,RawValueDataneeds javaObjectSerializer).- Specified by:
materializein classLazyBinaryFormat<T>
-
fromObject
Creates aBinaryRawValueDatainstance from the given Java object. -
fromBytes
Creates aBinaryStringDatainstance from the given bytes. -
fromBytes
Creates aBinaryStringDatainstance from the given bytes with offset and number of bytes.
-