Class ListSerializer<T>
- java.lang.Object
-
- org.apache.flink.api.common.typeutils.TypeSerializer<List<T>>
-
- org.apache.flink.cdc.runtime.serializer.ListSerializer<T>
-
- Type Parameters:
T- The type of element in the list.
- All Implemented Interfaces:
Serializable
public final class ListSerializer<T> extends org.apache.flink.api.common.typeutils.TypeSerializer<List<T>>
A serializer forLists. The serializer relies on an element serializer for the serialization of the list's elements.The serialization format for the list is as follows: four bytes for the length of the lost, followed by the serialized representation of each element.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classListSerializer.ListSerializerSnapshot<T>Snapshot class for theListSerializer.
-
Constructor Summary
Constructors Constructor Description ListSerializer(org.apache.flink.api.common.typeutils.TypeSerializer<T> elementSerializer)Creates a list serializer that uses the given serializer to serialize the list's elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>copy(List<T> from)List<T>copy(List<T> from, List<T> reuse)voidcopy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target)List<T>createInstance()List<T>deserialize(List<T> reuse, org.apache.flink.core.memory.DataInputView source)List<T>deserialize(org.apache.flink.core.memory.DataInputView source)org.apache.flink.api.common.typeutils.TypeSerializer<List<T>>duplicate()booleanequals(Object obj)org.apache.flink.api.common.typeutils.TypeSerializer<T>getElementSerializer()Gets the serializer for the elements of the list.intgetLength()inthashCode()booleanisImmutableType()voidserialize(List<T> list, org.apache.flink.core.memory.DataOutputView target)org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<List<T>>snapshotConfiguration()
-
-
-
Constructor Detail
-
ListSerializer
public ListSerializer(org.apache.flink.api.common.typeutils.TypeSerializer<T> elementSerializer)
Creates a list serializer that uses the given serializer to serialize the list's elements.- Parameters:
elementSerializer- The serializer for the elements of the list
-
-
Method Detail
-
getElementSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<T> getElementSerializer()
Gets the serializer for the elements of the list.- Returns:
- The serializer for the elements of the list
-
isImmutableType
public boolean isImmutableType()
-
getLength
public int getLength()
-
serialize
public void serialize(List<T> list, org.apache.flink.core.memory.DataOutputView target) throws IOException
- Specified by:
serializein classorg.apache.flink.api.common.typeutils.TypeSerializer<List<T>>- Throws:
IOException
-
deserialize
public List<T> deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
- Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<List<T>>- Throws:
IOException
-
deserialize
public List<T> deserialize(List<T> reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
- Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<List<T>>- Throws:
IOException
-
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<List<T>>- Throws:
IOException
-
equals
public boolean equals(Object obj)
-
hashCode
public int hashCode()
-
-