org.apache.ignite.internal.util

## Class GridSynchronizedMap<K,V>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.concurrent.ConcurrentHashMap<K,V>
    - - org.apache.ignite.internal.util.GridSynchronizedMap<K,V>

All Implemented Interfaces:
  Externalizable, Serializable, ConcurrentMap<K,V>, Map<K,V>

    public class GridSynchronizedMap<K,V>
    extends ConcurrentHashMap<K,V>
    implements Externalizable

Synchronized map for cache values that is safe to update in-place. Main reason for this map is to provide snapshot-guarantee for serialization and keep concurrent iterators.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap

`ConcurrentHashMap.KeySetView<K,V>`

### Nested classes/interfaces inherited from class java.util.AbstractMap

`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

### Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`GridSynchronizedMap()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clear()`
`V` `put(K key, V val)`
`void` `putAll(Map<? extends K,? extends V> m)`
`V` `putIfAbsent(K key, V val)`
`void` `readExternal(ObjectInput in)`
`V` `remove(Object key)`
`boolean` `remove(Object key, Object val)`
`V` `replace(K key, V val)`
`boolean` `replace(K key, V oldVal, V newVal)`
`void` `writeExternal(ObjectOutput out)`

### Methods inherited from class java.util.concurrent.ConcurrentHashMap

`compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values`

### Methods inherited from class java.util.AbstractMap

`clone`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridSynchronizedMap

    public GridSynchronizedMap()

### Method Detail

#### putIfAbsent

    public V putIfAbsent(K key,
                         V val)

Specified by:
  `putIfAbsent` in interface `ConcurrentMap<K,V>`
Specified by:
  `putIfAbsent` in interface `Map<K,V>`
Overrides:
  `putIfAbsent` in class `ConcurrentHashMap<K,V>`

#### remove

    public boolean remove(Object key,
                          Object val)

Specified by:
  `remove` in interface `ConcurrentMap<K,V>`
Specified by:
  `remove` in interface `Map<K,V>`
Overrides:
  `remove` in class `ConcurrentHashMap<K,V>`

#### replace

    public boolean replace(K key,
                           V oldVal,
                           V newVal)

Specified by:
  `replace` in interface `ConcurrentMap<K,V>`
Specified by:
  `replace` in interface `Map<K,V>`
Overrides:
  `replace` in class `ConcurrentHashMap<K,V>`

#### replace

    public V replace(K key,
                     V val)

Specified by:
  `replace` in interface `ConcurrentMap<K,V>`
Specified by:
  `replace` in interface `Map<K,V>`
Overrides:
  `replace` in class `ConcurrentHashMap<K,V>`

#### put

    public V put(K key,
                 V val)

Specified by:
  `put` in interface `Map<K,V>`
Overrides:
  `put` in class `ConcurrentHashMap<K,V>`

#### remove

    public V remove(Object key)

Specified by:
  `remove` in interface `Map<K,V>`
Overrides:
  `remove` in class `ConcurrentHashMap<K,V>`

#### putAll

    public void putAll(Map<? extends K,? extends V> m)

Specified by:
  `putAll` in interface `Map<K,V>`
Overrides:
  `putAll` in class `ConcurrentHashMap<K,V>`

#### clear

    public void clear()

Specified by:
  `clear` in interface `Map<K,V>`
Overrides:
  `clear` in class `ConcurrentHashMap<K,V>`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018