K - The type of the keys in the map.V - The type of the values in the map.public final class MapSerializer<K,V> extends org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>
Map. 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.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
MapSerializer.MapSerializerSnapshot<K,V>
Snapshot class for the
MapSerializer. |
| 构造器和说明 |
|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
Map<K,V> |
copy(Map<K,V> from) |
Map<K,V> |
copy(Map<K,V> from,
Map<K,V> reuse) |
Map<K,V> |
createInstance() |
Map<K,V> |
deserialize(org.apache.flink.core.memory.DataInputView source) |
Map<K,V> |
deserialize(Map<K,V> reuse,
org.apache.flink.core.memory.DataInputView source) |
org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>> |
duplicate() |
boolean |
equals(Object obj) |
org.apache.flink.api.common.typeutils.TypeSerializer<K> |
getKeySerializer() |
int |
getLength() |
org.apache.flink.api.common.typeutils.TypeSerializer<V> |
getValueSerializer() |
int |
hashCode() |
boolean |
isImmutableType() |
void |
serialize(Map<K,V> map,
org.apache.flink.core.memory.DataOutputView target) |
org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<Map<K,V>> |
snapshotConfiguration() |
public MapSerializer(org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
keySerializer - The serializer for the keys in the mapvalueSerializer - The serializer for the values in the mappublic org.apache.flink.api.common.typeutils.TypeSerializer<K> getKeySerializer()
public org.apache.flink.api.common.typeutils.TypeSerializer<V> getValueSerializer()
public boolean isImmutableType()
public int getLength()
public void serialize(Map<K,V> map, org.apache.flink.core.memory.DataOutputView target) throws IOException
serialize 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>IOExceptionpublic Map<K,V> deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>IOExceptionpublic Map<K,V> deserialize(Map<K,V> reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>IOExceptionpublic void copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target)
throws IOException
copy 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<Map<K,V>>IOExceptionpublic boolean equals(Object obj)
public int hashCode()
Copyright © 2025 The Apache Software Foundation. All rights reserved.