K
- The type of the keys in the map.V
- The type of the values in the map.@Internal public final class HashMapSerializer<K,V> extends org.apache.flink.api.common.typeutils.TypeSerializer<HashMap<K,V>>
HashMap
. 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.
Constructor and Description |
---|
HashMapSerializer(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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canEqual(Object obj) |
void |
copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
HashMap<K,V> |
copy(HashMap<K,V> from) |
HashMap<K,V> |
copy(HashMap<K,V> from,
HashMap<K,V> reuse) |
HashMap<K,V> |
createInstance() |
HashMap<K,V> |
deserialize(org.apache.flink.core.memory.DataInputView source) |
HashMap<K,V> |
deserialize(HashMap<K,V> reuse,
org.apache.flink.core.memory.DataInputView source) |
org.apache.flink.api.common.typeutils.TypeSerializer<HashMap<K,V>> |
duplicate() |
org.apache.flink.api.common.typeutils.CompatibilityResult<HashMap<K,V>> |
ensureCompatibility(org.apache.flink.api.common.typeutils.TypeSerializerConfigSnapshot configSnapshot) |
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(HashMap<K,V> map,
org.apache.flink.core.memory.DataOutputView target) |
org.apache.flink.api.common.typeutils.TypeSerializerConfigSnapshot |
snapshotConfiguration() |
public HashMapSerializer(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(HashMap<K,V> map, org.apache.flink.core.memory.DataOutputView target) throws IOException
serialize
in class org.apache.flink.api.common.typeutils.TypeSerializer<HashMap<K,V>>
IOException
public HashMap<K,V> deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize
in class org.apache.flink.api.common.typeutils.TypeSerializer<HashMap<K,V>>
IOException
public HashMap<K,V> deserialize(HashMap<K,V> reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize
in class org.apache.flink.api.common.typeutils.TypeSerializer<HashMap<K,V>>
IOException
public void copy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) throws IOException
copy
in class org.apache.flink.api.common.typeutils.TypeSerializer<HashMap<K,V>>
IOException
public boolean equals(Object obj)
public boolean canEqual(Object obj)
public int hashCode()
public org.apache.flink.api.common.typeutils.TypeSerializerConfigSnapshot snapshotConfiguration()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.