Class RowDataSerializer
java.lang.Object
org.apache.flink.api.common.typeutils.TypeSerializer<T>
org.apache.flink.table.runtime.typeutils.PagedTypeSerializer<T>
org.apache.flink.table.runtime.typeutils.AbstractRowDataSerializer<org.apache.flink.table.data.RowData>
org.apache.flink.table.runtime.typeutils.RowDataSerializer
- All Implemented Interfaces:
Serializable
@Internal
public class RowDataSerializer
extends AbstractRowDataSerializer<org.apache.flink.table.data.RowData>
Serializer for
RowData.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTypeSerializerSnapshotforBinaryRowDataSerializer. -
Constructor Summary
ConstructorsConstructorDescriptionRowDataSerializer(org.apache.flink.table.types.logical.LogicalType... types) RowDataSerializer(org.apache.flink.table.types.logical.LogicalType[] types, org.apache.flink.api.common.typeutils.TypeSerializer<?>[] fieldSerializers) RowDataSerializer(org.apache.flink.table.types.logical.RowType rowType) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) org.apache.flink.table.data.RowDatacopy(org.apache.flink.table.data.RowData from) org.apache.flink.table.data.RowDatacopy(org.apache.flink.table.data.RowData from, org.apache.flink.table.data.RowData reuse) org.apache.flink.table.data.RowDataorg.apache.flink.table.data.RowDatadeserialize(org.apache.flink.core.memory.DataInputView source) org.apache.flink.table.data.RowDatadeserialize(org.apache.flink.table.data.RowData reuse, org.apache.flink.core.memory.DataInputView source) org.apache.flink.table.data.RowDatadeserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) De-serializes a record from the given source paged input view.org.apache.flink.table.data.RowDatadeserializeFromPages(org.apache.flink.table.data.RowData reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) Reuse version ofPagedTypeSerializer.deserializeFromPages(AbstractPagedInputView).org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>booleanintgetArity()Get the number of fields.intinthashCode()booleanorg.apache.flink.table.data.RowDatamapFromPages(org.apache.flink.table.data.RowData reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) Map a reused record from the given source paged input view.voidserialize(org.apache.flink.table.data.RowData row, org.apache.flink.core.memory.DataOutputView target) intserializeToPages(org.apache.flink.table.data.RowData row, org.apache.flink.runtime.memory.AbstractPagedOutputView target) Serializes the given record to the given target paged output view.voidskipRecordFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) Skip over bytes of one record from the paged input view, discarding the skipped bytes.org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<org.apache.flink.table.data.RowData>org.apache.flink.table.data.binary.BinaryRowDatatoBinaryRow(org.apache.flink.table.data.RowData row) ConvertRowDataintoBinaryRowData.
-
Constructor Details
-
RowDataSerializer
public RowDataSerializer(org.apache.flink.table.types.logical.RowType rowType) -
RowDataSerializer
public RowDataSerializer(org.apache.flink.table.types.logical.LogicalType... types) -
RowDataSerializer
public RowDataSerializer(org.apache.flink.table.types.logical.LogicalType[] types, org.apache.flink.api.common.typeutils.TypeSerializer<?>[] fieldSerializers)
-
-
Method Details
-
duplicate
public org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> duplicate()- Specified by:
duplicatein classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
createInstance
public org.apache.flink.table.data.RowData createInstance()- Specified by:
createInstancein classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
serialize
public void serialize(org.apache.flink.table.data.RowData row, org.apache.flink.core.memory.DataOutputView target) throws IOException - Specified by:
serializein classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>- Throws:
IOException
-
deserialize
public org.apache.flink.table.data.RowData deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException - Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>- Throws:
IOException
-
deserialize
public org.apache.flink.table.data.RowData deserialize(org.apache.flink.table.data.RowData reuse, org.apache.flink.core.memory.DataInputView source) throws IOException - Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>- Throws:
IOException
-
copy
public org.apache.flink.table.data.RowData copy(org.apache.flink.table.data.RowData from) - Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
copy
public org.apache.flink.table.data.RowData copy(org.apache.flink.table.data.RowData from, org.apache.flink.table.data.RowData reuse) - Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
copy
public void copy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) throws IOException - Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>- Throws:
IOException
-
getArity
public int getArity()Description copied from class:AbstractRowDataSerializerGet the number of fields.- Specified by:
getArityin classAbstractRowDataSerializer<org.apache.flink.table.data.RowData>
-
toBinaryRow
public org.apache.flink.table.data.binary.BinaryRowData toBinaryRow(org.apache.flink.table.data.RowData row) ConvertRowDataintoBinaryRowData. TODO modify it to code gen.- Specified by:
toBinaryRowin classAbstractRowDataSerializer<org.apache.flink.table.data.RowData>
-
serializeToPages
public int serializeToPages(org.apache.flink.table.data.RowData row, org.apache.flink.runtime.memory.AbstractPagedOutputView target) throws IOException Description copied from class:PagedTypeSerializerSerializes the given record to the given target paged output view. Some implementations may skip some bytes if current page does not have enough space left, .e.gBinaryRowData.- Specified by:
serializeToPagesin classPagedTypeSerializer<org.apache.flink.table.data.RowData>- Parameters:
row- The record to serialize.target- The output view to write the serialized data to.- Returns:
- Returns the skipped number of bytes.
- Throws:
IOException- Thrown, if the serialization encountered an I/O related error. Typically raised by the output view, which may have an underlying I/O channel to which it delegates.
-
deserializeFromPages
public org.apache.flink.table.data.RowData deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerDe-serializes a record from the given source paged input view. For consistency with serialize format, some implementations may need to skip some bytes of source before de-serializing, .e.gBinaryRowData. Typically, the content read from source should be copied out when de-serializing, and we are not expecting the underlying data from source is reused. If you have such requirement, seePagedTypeSerializer.mapFromPages(T, AbstractPagedInputView).- Specified by:
deserializeFromPagesin classPagedTypeSerializer<org.apache.flink.table.data.RowData>- Parameters:
source- The input view from which to read the data.- Returns:
- The de-serialized element.
- Throws:
IOException- Thrown, if the de-serialization encountered an I/O related error. Typically raised by the input view, which may have an underlying I/O channel from which it reads.
-
deserializeFromPages
public org.apache.flink.table.data.RowData deserializeFromPages(org.apache.flink.table.data.RowData reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerReuse version ofPagedTypeSerializer.deserializeFromPages(AbstractPagedInputView).- Specified by:
deserializeFromPagesin classPagedTypeSerializer<org.apache.flink.table.data.RowData>- Throws:
IOException
-
mapFromPages
public org.apache.flink.table.data.RowData mapFromPages(org.apache.flink.table.data.RowData reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerMap a reused record from the given source paged input view. This method provides a possibility to achieve zero copy when de-serializing. You can either choose copy or not copy the content read from source, but we encourage to make it zero copy.If you choose the zero copy way, you have to deal with the lifecycle of the pages properly.
- Specified by:
mapFromPagesin classPagedTypeSerializer<org.apache.flink.table.data.RowData>- Parameters:
reuse- the reused record to be mappedsource- The input view from which to read the data.- Returns:
- The mapped record.
- Throws:
IOException- Thrown, if the de-serialization encountered an I/O related error. Typically raised by the input view, which may have an underlying I/O channel from which it reads.
-
skipRecordFromPages
public void skipRecordFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerSkip over bytes of one record from the paged input view, discarding the skipped bytes.- Specified by:
skipRecordFromPagesin classPagedTypeSerializer<org.apache.flink.table.data.RowData>- Throws:
IOException
-
equals
- Specified by:
equalsin classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
hashCode
public int hashCode()- Specified by:
hashCodein classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
isImmutableType
public boolean isImmutableType()- Specified by:
isImmutableTypein classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
getLength
public int getLength()- Specified by:
getLengthin classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-
snapshotConfiguration
public org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<org.apache.flink.table.data.RowData> snapshotConfiguration()- Specified by:
snapshotConfigurationin classorg.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>
-