Class SortedMapSerializer<K,V>
java.lang.Object
org.apache.flink.api.common.typeutils.TypeSerializer<M>
org.apache.flink.table.runtime.typeutils.SortedMapSerializer<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 SortedMapSerializer<K,V>
extends org.apache.flink.api.common.typeutils.TypeSerializer<M>
A serializer for
SortedMap. The serializer relies on a key serializer and a value
serializer for the serialization of the map's key-value pairs. It also deploys a comparator to
ensure the order of the keys.
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 flag.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSortedMapSerializer(Comparator<K> comparator, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer) Constructor with given comparator, and the serializers for the keys and values in the map. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) deserialize(SortedMap<K, V> reuse, org.apache.flink.core.memory.DataInputView source) deserialize(org.apache.flink.core.memory.DataInputView source) booleanReturns the comparator for the keys in the map.org.apache.flink.api.common.typeutils.TypeSerializer<K>Returns the serializer for the keys in the map.intorg.apache.flink.api.common.typeutils.TypeSerializer<V>Returns the serializer for the values in the map.inthashCode()booleanvoidtoString()
-
Constructor Details
-
SortedMapSerializer
public SortedMapSerializer(Comparator<K> comparator, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer) Constructor with given comparator, and the serializers for the keys and values in the map.- Parameters:
comparator- The comparator for the keys in the map.keySerializer- The serializer for the keys in the map.valueSerializer- The serializer for the values in the map.
-
-
Method Details
-
getComparator
Returns the comparator for the keys in the map.- Returns:
- The comparator for the keys in the map.
-
duplicate
-
createInstance
-
equals
-
hashCode
public int hashCode() -
toString
-
snapshotConfiguration
-
getKeySerializer
Returns the serializer for the keys in the map.- Returns:
- The serializer for the keys in the map.
-
getValueSerializer
Returns the serializer for the values in the map.- Returns:
- The serializer for the values in the map.
-
isImmutableType
public boolean isImmutableType()- Specified by:
isImmutableTypein classorg.apache.flink.api.common.typeutils.TypeSerializer<M extends Map<K,V>>
-
copy
- Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<M extends Map<K,V>>
-
copy
- Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<M extends Map<K,V>>
-
getLength
public int getLength()- Specified by:
getLengthin classorg.apache.flink.api.common.typeutils.TypeSerializer<M extends Map<K,V>>
-
serialize
public void serialize(SortedMap<K, V> map, org.apache.flink.core.memory.DataOutputView target) throws IOException- Specified by:
serializein classorg.apache.flink.api.common.typeutils.TypeSerializer<M extends Map<K,V>> - Throws:
IOException
-
deserialize
public SortedMap<K,V> deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException - Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<M extends Map<K,V>> - Throws:
IOException
-
deserialize
public SortedMap<K,V> deserialize(SortedMap<K, V> reuse, org.apache.flink.core.memory.DataInputView source) throws IOException- Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<M extends 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<M extends Map<K,V>> - Throws:
IOException
-