org.terracotta.collections
Class EnterpriseConcurrentDistributedMap<K,V>

java.lang.Object
  extended by org.terracotta.collections.ConcurrentDistributedMap<K,V>
      extended by org.terracotta.collections.ConcurrentDistributedServerMap<K,V>
          extended by org.terracotta.collections.EnterpriseConcurrentDistributedMap<K,V>
Type Parameters:
K - type of mapped keys
V - type of mapped values
All Implemented Interfaces:
com.terracotta.toolkit.collections.InternalClusteredMap<K,V>, com.terracotta.toolkit.collections.InternalLocallyCacheable, ConcurrentMap<K,V>, Map<K,V>, CacheEvictionListenerSupport, LocallyCacheable, ClusteredMap<K,V>, MutatorsWithCallbacks<K,V>, LockableMap<K>

public class EnterpriseConcurrentDistributedMap<K,V>
extends ConcurrentDistributedServerMap<K,V>
implements LocallyCacheable, CacheEvictionListenerSupport

A ConcurrentMap that automatically switches its implementation to one that is highly concurrent server-side map in a Terracotta DSO cluster. When Terracotta DSO isn't active, a traditional ConcurrentMap implementation like ConcurrentHashMap is used within a single JVM.

Map entries can't use null for keys or values.

One of the map difference between EnterpriseConcurrentDistributedMap and ConcurrentDistributedMap is the DCV2 Storage Strategy; This allows for an unlimited key-space for this map.

Author:
Abhishek Sanoujam , Nabib El-Rahman

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static int SERVERMAP_DEFAULT_CONCURRENCY
           
 
Fields inherited from class org.terracotta.collections.ConcurrentDistributedMap
cacheConfig, DEFAULT_CONCURRENCY, DEFAULT_INVALIDATE_ON_CHANGE, deleteValueOnRemove, invalidateOnChange, map, mutateCallbacks
 
Constructor Summary
EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig, LockType lockType, GenericLockStrategy<L,? super K> lockStrategy, int concurrency)
           
EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig, LockType lockType, GenericLockStrategy<L,? super K> lockStrategy, int concurrency, boolean invalidateOnChange)
           
EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig, LockType lockType, GenericLockStrategy<L,? super K> lockStrategy, int concurrency, boolean invalidateOnChange, boolean deleteValueOnRemove)
           
EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig, LockType lockType, LockStrategy<? super K> lockStrategy)
          Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active and the concurrency of internal data structures.
EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig, LockType lockType, LockStrategy<? super K> lockStrategy, int concurrency)
          Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active and the concurrency of internal data structures.
EnterpriseConcurrentDistributedMap(LockType lockType, LockStrategy<? super K> lockStrategy)
          Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active.
EnterpriseConcurrentDistributedMap(LockType lockType, LockStrategy<? super K> lockStrategy, int concurrency)
          Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active and the concurrency of internal data structures
 
Method Summary
 
Methods inherited from class org.terracotta.collections.ConcurrentDistributedServerMap
addCacheEvictionListener, clearLocalCache, containsKeyLocalOffHeap, containsKeyLocalOnHeap, destroyLocalCache, getAllEntriesSnapshot, initBackend, initializeLocalCache, isEmpty, localOffHeapSize, localOffHeapSizeInBytes, localOnHeapSize, localOnHeapSizeInBytes, onLoad, recalculateLocalCacheSize, removeCacheEvictionListener, setLocalCacheEnabled, setMaxBytesLocalHeap, setMaxEntriesLocalHeap, setMaxTTI, setMaxTTL, setTargetMaxTotalCount, size
 
Methods inherited from class org.terracotta.collections.ConcurrentDistributedMap
__tc_applicator_clear, __tc_applicator_put, __tc_applicator_remove, __tc_getAllEntriesSnapshot, __tc_getAllLocalEntriesSnapshot, __tc_put_logical, __tc_remove_logical, checkInObject, checkOutObject, clear, clearWithCallback, containsKey, containsLocalKey, containsValue, createFinegrainedLock, entrySet, flush, get, getAllLocalEntriesSnapshot, getConstituentMaps, getRandomEntry, getRandomLocalEntry, isPinned, keySet, localKeySet, localSize, lockEntry, put, putAll, putIfAbsent, putNoReturn, putNoReturnWithCallback, registerMapSizeListener, remove, remove, removeNoReturn, removeNoReturnWithCallback, removeWithCallback, removeWithCallback, replace, replace, setPinned, tryRemove, unlockedGet, unlockedGetAll, unlockedPutIfAbsentNoReturn, unlockedPutIfAbsentNoReturnWithCallback, unlockedPutNoReturn, unlockedPutNoReturnWithCallback, unlockedRemoveNoReturn, unlockedRemoveNoReturn, unlockedRemoveNoReturnWithCallback, unlockedRemoveNoReturnWithCallback, unlockedReplaceNoReturn, unlockedReplaceNoReturnWithCallback, unlockEntry, unpinAll, unsafeGet, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.terracotta.cache.LocallyCacheable
clearLocalCache
 
Methods inherited from interface org.terracotta.cache.CacheEvictionListenerSupport
addCacheEvictionListener, removeCacheEvictionListener
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

SERVERMAP_DEFAULT_CONCURRENCY

public static final int SERVERMAP_DEFAULT_CONCURRENCY
See Also:
Constant Field Values
Constructor Detail

EnterpriseConcurrentDistributedMap

public EnterpriseConcurrentDistributedMap(LockType lockType,
                                          LockStrategy<? super K> lockStrategy)
Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active.

Parameters:
lockType - the lock type that should be used internally when Terracotta DSO is active
lockStrategy - the lock strategy to use for this map
See Also:
LockType, LockStrategy

EnterpriseConcurrentDistributedMap

public EnterpriseConcurrentDistributedMap(LockType lockType,
                                          LockStrategy<? super K> lockStrategy,
                                          int concurrency)
Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active and the concurrency of internal data structures

Parameters:
lockType - the lock type that should be used internally when Terracotta DSO is active
lockStrategy - the lock strategy to use for this map
concurrency - the estimated number of concurrently updating threads
See Also:
LockType, LockStrategy

EnterpriseConcurrentDistributedMap

public EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig,
                                          LockType lockType,
                                          LockStrategy<? super K> lockStrategy)
Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active and the concurrency of internal data structures.

Parameters:
cacheConfig - specific configuration for cache (i.e. tti, tti)
lockType - the lock type that should be used internally when Terracotta DSO is active
lockStrategy - the lock strategy to use for this map
See Also:
CacheConfig, LockType, LockStrategy

EnterpriseConcurrentDistributedMap

public EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig,
                                          LockType lockType,
                                          LockStrategy<? super K> lockStrategy,
                                          int concurrency)
Creates a new EnterpriseConcurrentDistributedMap instance that allows the specification of the internal lock type that should be used when Terracotta DSO is active and the concurrency of internal data structures.

Parameters:
cacheConfig - specific configuration for cache (i.e. tti, tti)
lockType - the lock type that should be used internally when Terracotta DSO is active
lockStrategy - the lock strategy to use for this map
concurrency - the estimated number of concurrently updating threads
See Also:
CacheConfig, LockType, LockStrategy

EnterpriseConcurrentDistributedMap

public EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig,
                                          LockType lockType,
                                          GenericLockStrategy<L,? super K> lockStrategy,
                                          int concurrency)

EnterpriseConcurrentDistributedMap

public EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig,
                                          LockType lockType,
                                          GenericLockStrategy<L,? super K> lockStrategy,
                                          int concurrency,
                                          boolean invalidateOnChange)

EnterpriseConcurrentDistributedMap

public EnterpriseConcurrentDistributedMap(CacheConfig cacheConfig,
                                          LockType lockType,
                                          GenericLockStrategy<L,? super K> lockStrategy,
                                          int concurrency,
                                          boolean invalidateOnChange,
                                          boolean deleteValueOnRemove)


Copyright © 2015 Terracotta, Inc.. All Rights Reserved.