public abstract class AbstractRowSerializer<T extends BaseRow>
extends org.apache.flink.api.common.typeutils.TypeSerializer<T>
| Constructor and Description |
|---|
AbstractRowSerializer() |
| 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 int |
getArity()
Get the number of fields.
|
abstract T |
mapFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source)
Map a record from the given source paged input view.
|
abstract T |
mapFromPages(T reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView source)
Reuse version of
mapFromPages(AbstractPagedInputView). |
abstract int |
serializeToPages(T record,
org.apache.flink.runtime.memory.AbstractPagedOutputView target)
Serializes the given record to the given target paged output view.
|
abstract BinaryRow |
toBinaryRow(T baseRow)
|
public abstract int getArity()
public abstract BinaryRow toBinaryRow(T baseRow) throws IOException
IOExceptionpublic abstract int serializeToPages(T record, org.apache.flink.runtime.memory.AbstractPagedOutputView target) throws IOException
BinaryRow.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
BinaryRow. 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(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(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.
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 mapFromPages(T reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException
mapFromPages(AbstractPagedInputView).IOExceptionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.