Class MapViewSerializer<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, org.apache.flink.api.common.typeutils.LegacySerializerSnapshotTransformer<MapView<K,​V>>

    @Internal
    @Deprecated
    public class MapViewSerializer<K,​V>
    extends org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
    implements org.apache.flink.api.common.typeutils.LegacySerializerSnapshotTransformer<MapView<K,​V>>
    Deprecated.
    A serializer for MapView. 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
    • Constructor Detail

      • MapViewSerializer

        public MapViewSerializer​(org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,​V>> mapSerializer)
        Deprecated.
    • Method Detail

      • isImmutableType

        public boolean isImmutableType()
        Deprecated.
        Specified by:
        isImmutableType in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • duplicate

        public org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>> duplicate()
        Deprecated.
        Specified by:
        duplicate in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • createInstance

        public MapView<K,​V> createInstance()
        Deprecated.
        Specified by:
        createInstance in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • copy

        public MapView<K,​V> copy​(MapView<K,​V> from)
        Deprecated.
        Specified by:
        copy in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • copy

        public MapView<K,​V> copy​(MapView<K,​V> from,
                                       MapView<K,​V> reuse)
        Deprecated.
        Specified by:
        copy in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • getLength

        public int getLength()
        Deprecated.
        Specified by:
        getLength in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • serialize

        public void serialize​(MapView<K,​V> record,
                              org.apache.flink.core.memory.DataOutputView target)
                       throws IOException
        Deprecated.
        Specified by:
        serialize in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
        Throws:
        IOException
      • deserialize

        public MapView<K,​V> deserialize​(org.apache.flink.core.memory.DataInputView source)
                                       throws IOException
        Deprecated.
        Specified by:
        deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
        Throws:
        IOException
      • deserialize

        public MapView<K,​V> deserialize​(MapView<K,​V> reuse,
                                              org.apache.flink.core.memory.DataInputView source)
                                       throws IOException
        Deprecated.
        Specified by:
        deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
        Throws:
        IOException
      • copy

        public void copy​(org.apache.flink.core.memory.DataInputView source,
                         org.apache.flink.core.memory.DataOutputView target)
                  throws IOException
        Deprecated.
        Specified by:
        copy in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
        Throws:
        IOException
      • equals

        public boolean equals​(Object obj)
        Deprecated.
        Specified by:
        equals in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • hashCode

        public int hashCode()
        Deprecated.
        Specified by:
        hashCode in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • snapshotConfiguration

        public org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<MapView<K,​V>> snapshotConfiguration()
        Deprecated.
        Specified by:
        snapshotConfiguration in class org.apache.flink.api.common.typeutils.TypeSerializer<MapView<K,​V>>
      • transformLegacySerializerSnapshot

        public <U> org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<MapView<K,​V>> transformLegacySerializerSnapshot​(org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<U> legacySnapshot)
        Deprecated.
        We need to override this as a LegacySerializerSnapshotTransformer because in Flink 1.6.x and below, this serializer was incorrectly returning directly the snapshot of the nested map serializer as its own snapshot.

        This method transforms the incorrect map serializer snapshot to be a proper MapViewSerializerSnapshot.

        Specified by:
        transformLegacySerializerSnapshot in interface org.apache.flink.api.common.typeutils.LegacySerializerSnapshotTransformer<K>
      • getMapSerializer

        public org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,​V>> getMapSerializer()
        Deprecated.