org.apache.ignite.cluster

## Interface ClusterNodeLocalMap<K,V>

All Superinterfaces:
  ConcurrentMap<K,V>, Map<K,V>

All Known Implementing Classes:
  ClusterNodeLocalMapImpl

    public interface ClusterNodeLocalMap<K,V>
    extends ConcurrentMap<K,V>

Defines interface for node-local storage.

`GridNodeLocalMap` is similar to `ThreadLocal` in a way that its values are not distributed and kept only on local node (similar like `ThreadLocal` values are attached to the current thread only). Node-local values are used primarily by jobs executed from the remote nodes to keep intermediate state on the local node between executions.

`GridNodeLocalMap` essentially is a `ConcurrentMap` with a few additional methods, so it is fairly trivial to use.

You can get an instance of `GridNodeLocalMap` by calling `IgniteCluster.nodeLocalMap()` method.

### Nested Class Summary

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

`Map.Entry<K,V>`

### Method Summary

Methods
`V` `addIfAbsent(K key, Callable<V> dflt)` Gets the value with given key.
`V` `addIfAbsent(K key, V val)` Unlike its sibling method `ConcurrentMap.putIfAbsent(Object, Object)` this method returns current mapping from the map.

### Methods inherited from interface java.util.concurrent.ConcurrentMap

`putIfAbsent, remove, replace, replace`

### Methods inherited from interface java.util.Map

`clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

### Method Detail

#### addIfAbsent

    V addIfAbsent(K key,
                @Nullable
                Callable<V> dflt)

Gets the value with given key. If that value does not exist, calls given closure to get the default value, puts it into the map and returns it. If closure is `null` return `null`.

Parameters:
  `key` - Key to get the value for.
  `dflt` - Default value producing closure.
Returns:
  Value for the key or the value produced by the closure if key does not exist in the map. Return `null` if key is not found and closure is `null`.

#### addIfAbsent

    V addIfAbsent(K key,
                V val)

Unlike its sibling method `ConcurrentMap.putIfAbsent(Object, Object)` this method returns current mapping from the map.

Parameters:
  `key` - Key.
  `val` - Value to put if one does not exist.
Returns:
  Current mapping for a given key.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015