public abstract class ObjectSerializer<T> extends Object implements Serializable
RowDataSerializer
.Modifier and Type | Field and Description |
---|---|
protected org.apache.flink.table.runtime.typeutils.RowDataSerializer |
rowSerializer |
Constructor and Description |
---|
ObjectSerializer(org.apache.flink.table.types.logical.RowType rowType) |
Modifier and Type | Method and Description |
---|---|
T |
deserialize(org.apache.flink.core.memory.DataInputView source)
De-serializes a record from the given source input view.
|
List<T> |
deserializeList(byte[] bytes) |
List<T> |
deserializeList(org.apache.flink.core.memory.DataInputView source)
De-serializes a record list from the given source input view.
|
abstract T |
fromRow(org.apache.flink.table.data.RowData rowData)
Convert a
RowData to T . |
int |
numFields()
Get the number of fields.
|
void |
serialize(T record,
org.apache.flink.core.memory.DataOutputView target)
Serializes the given record to the given target output view.
|
byte[] |
serializeList(List<T> records) |
void |
serializeList(List<T> records,
org.apache.flink.core.memory.DataOutputView target)
Serializes the given record list to the given target output view.
|
abstract org.apache.flink.table.data.RowData |
toRow(T record)
Convert a
T to RowData . |
protected final org.apache.flink.table.runtime.typeutils.RowDataSerializer rowSerializer
public ObjectSerializer(org.apache.flink.table.types.logical.RowType rowType)
public int numFields()
public final void serialize(T record, org.apache.flink.core.memory.DataOutputView target) throws IOException
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 final T deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
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 final void serializeList(List<T> records, org.apache.flink.core.memory.DataOutputView target) throws IOException
IOException
public final byte[] serializeList(List<T> records) throws IOException
IOException
public final List<T> deserializeList(org.apache.flink.core.memory.DataInputView source) throws IOException
IOException
public final List<T> deserializeList(byte[] bytes) throws IOException
IOException
public abstract org.apache.flink.table.data.RowData toRow(T record)
T
to RowData
.public abstract T fromRow(org.apache.flink.table.data.RowData rowData)
RowData
to T
.Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.