GridGain™ 3.6.0e
Enterprise Edition

org.gridgain.grid
Interface GridNodeLocal<K,V>

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

public interface GridNodeLocal<K,V>
extends ConcurrentMap<K,V>, GridMetadataAware

Defines interface for node-local storage.

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

Currently, this interface simply extends ConcurrentMap and serves as a future extension point.

Wiki & Forum:


Wiki
Forum

 

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 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
 
Methods inherited from interface org.gridgain.grid.GridMetadataAware
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta
 

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.

GridGain™ 3.6.0e
Enterprise Edition

GridGain - Real Time Big Data
Enterprise Edition, ver. 3.6.0e.13012012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Follow GridGain on Facebook Join GridGain User Group Follow GridGain on Twitter Follow GridGain on YouTube