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