@Internal
public abstract class PagedTypeSerializer<T>
extends org.apache.flink.api.common.typeutils.TypeSerializer<T>
| Constructor and Description |
|---|
PagedTypeSerializer() |
| Modifier and Type | Method and Description |
|---|---|
abstract T |
deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source)
De-serializes a record from the given source paged input view.
|
abstract T |
deserializeFromPages(T reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView source)
Reuse version of
deserializeFromPages(AbstractPagedInputView). |
abstract T |
mapFromPages(T reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView source)
Map a reused record from the given source paged input view.
|
abstract int |
serializeToPages(T record,
org.apache.flink.runtime.memory.AbstractPagedOutputView target)
Serializes the given record to the given target paged output view.
|
abstract void |
skipRecordFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source)
Skip over bytes of one record from the paged input view, discarding the skipped bytes.
|
public abstract int serializeToPages(T record, org.apache.flink.runtime.memory.AbstractPagedOutputView target) throws IOException
BinaryRowData.record - The record to serialize.target - The output view to write the serialized data to.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.public abstract T deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException
BinaryRowData. 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, see #mapFromPages(T, AbstractPagedInputView).source - The input view from which to read the data.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.public abstract T deserializeFromPages(T reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException
deserializeFromPages(AbstractPagedInputView).IOExceptionpublic abstract T mapFromPages(T reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException
If you choose the zero copy way, you have to deal with the lifecycle of the pages properly.
reuse - the reused record to be mappedsource - The input view from which to read the data.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.public abstract void skipRecordFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source)
throws IOException
IOExceptionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.