Class MapSerializer<K,V>
- java.lang.Object
-
- org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>
-
- org.apache.flink.cdc.runtime.serializer.MapSerializer<K,V>
-
- Type Parameters:
K- The type of the keys in the map.V- The type of the values in the map.
- All Implemented Interfaces:
Serializable
public final class MapSerializer<K,V> extends org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>
A serializer forMap. The serializer relies on a key serializer and a value serializer for the serialization of the map's key-value pairs.The serialization format for the map is as follows: four bytes for the length of the map, followed by the serialized representation of each key-value pair. To allow null values, each value is prefixed by a null marker.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapSerializer.MapSerializerSnapshot<K,V>Snapshot class for theMapSerializer.
-
Constructor Summary
Constructors Constructor Description MapSerializer(org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)Creates a map serializer that uses the given serializers to serialize the key-value pairs in the map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<K,V>copy(Map<K,V> from)Map<K,V>copy(Map<K,V> from, Map<K,V> reuse)voidcopy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target)Map<K,V>createInstance()Map<K,V>deserialize(Map<K,V> reuse, org.apache.flink.core.memory.DataInputView source)Map<K,V>deserialize(org.apache.flink.core.memory.DataInputView source)org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>duplicate()booleanequals(Object obj)org.apache.flink.api.common.typeutils.TypeSerializer<K>getKeySerializer()intgetLength()org.apache.flink.api.common.typeutils.TypeSerializer<V>getValueSerializer()inthashCode()booleanisImmutableType()voidserialize(Map<K,V> map, org.apache.flink.core.memory.DataOutputView target)org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<Map<K,V>>snapshotConfiguration()
-
-
-
Constructor Detail
-
MapSerializer
public MapSerializer(org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
Creates a map serializer that uses the given serializers to serialize the key-value pairs in the map.- Parameters:
keySerializer- The serializer for the keys in the mapvalueSerializer- The serializer for the values in the map
-
-
Method Detail
-
getKeySerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<K> getKeySerializer()
-
getValueSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<V> getValueSerializer()
-
isImmutableType
public boolean isImmutableType()
-
getLength
public int getLength()
-
serialize
public void serialize(Map<K,V> map, org.apache.flink.core.memory.DataOutputView target) throws IOException
- Specified by:
serializein classorg.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>- Throws:
IOException
-
deserialize
public Map<K,V> deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
- Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>- Throws:
IOException
-
deserialize
public Map<K,V> deserialize(Map<K,V> reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
- Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>- 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<Map<K,V>>- Throws:
IOException
-
equals
public boolean equals(Object obj)
-
hashCode
public int hashCode()
-
-