Package com.tangosol.net.cache
Class BundlingNamedCache
- java.lang.Object
-
- com.tangosol.util.Base
-
- com.tangosol.util.AbstractKeyBasedMap<K,V>
-
- com.tangosol.util.AbstractKeySetBasedMap<K,V>
-
- com.tangosol.util.WrapperObservableMap<K,V>
-
- com.tangosol.util.WrapperConcurrentMap<K,V>
-
- com.tangosol.net.cache.WrapperNamedCache
-
- com.tangosol.net.cache.BundlingNamedCache
-
- All Implemented Interfaces:
CacheMap
,NamedCache
,NamedCollection
,NamedMap
,Releasable
,ConcurrentMap
,InvocableMap
,ObservableMap
,QueryMap
,AutoCloseable
,Map
public class BundlingNamedCache extends WrapperNamedCache
Bundling NamedCache implementation.- Since:
- Coherence 3.3
- Author:
- gg 2007.02.13
- See Also:
AbstractBundler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
BundlingNamedCache.GetBundler
protected class
BundlingNamedCache.PutBundler
protected class
BundlingNamedCache.RemoveBundler
-
Nested classes/interfaces inherited from class com.tangosol.util.WrapperConcurrentMap
WrapperConcurrentMap.Lock
-
Nested classes/interfaces inherited from class com.tangosol.util.WrapperObservableMap
WrapperObservableMap.InternalListener
-
Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeySetBasedMap
AbstractKeySetBasedMap.EntrySet, AbstractKeySetBasedMap.KeyIterator, AbstractKeySetBasedMap.KeySet, AbstractKeySetBasedMap.ValuesCollection
-
Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeyBasedMap
AbstractKeyBasedMap.DeferredCacheEvent<K,V>
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
Nested classes/interfaces inherited from interface com.tangosol.util.InvocableMap
InvocableMap.Entry<K,V>, InvocableMap.EntryAggregator<K,V,R>, InvocableMap.EntryProcessor<K,V,R>, InvocableMap.ParallelAwareAggregator<K,V,P,R>, InvocableMap.StreamingAggregator<K,V,P,R>
-
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K extends Object,V extends Object>
-
Nested classes/interfaces inherited from interface com.tangosol.net.NamedMap
NamedMap.Option
-
Nested classes/interfaces inherited from interface com.tangosol.util.QueryMap
QueryMap.Entry<K,V>
-
-
Field Summary
-
Fields inherited from class com.tangosol.net.cache.WrapperNamedCache
m_service, m_sName
-
Fields inherited from class com.tangosol.util.WrapperConcurrentMap
m_cWaitMillis, m_fEnforceLocking, m_gateMap, m_mapLock
-
Fields inherited from class com.tangosol.util.WrapperObservableMap
m_fDeferredEvent, m_fTranslateEvents, m_listenerInternal, m_listenerSupport, m_map, m_stats
-
Fields inherited from class com.tangosol.util.Base
LOG_ALWAYS, LOG_CONFIG, LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_MAX, LOG_MIN, LOG_QUIET, LOG_WARN, POWER_0, POWER_G, POWER_K, POWER_M, POWER_T, UNIT_D, UNIT_H, UNIT_M, UNIT_MS, UNIT_NS, UNIT_S, UNIT_US
-
Fields inherited from interface com.tangosol.net.cache.CacheMap
EXPIRY_DEFAULT, EXPIRY_NEVER
-
Fields inherited from interface com.tangosol.util.ConcurrentMap
LOCK_ALL
-
-
Constructor Summary
Constructors Constructor Description BundlingNamedCache(NamedCache cache)
Construct a BundlingNamedCache based on the specified NamedCache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractBundler
ensureGetBundler(int cBundleThreshold)
Configure the bundler for the "get" operations.AbstractBundler
ensurePutBundler(int cBundleThreshold)
Configure the bundler for the "put" operations.AbstractBundler
ensureRemoveBundler(int cBundleThreshold)
Configure the bundler for the "remove" operations.Object
get(Object oKey)
Returns the value to which this map maps the specified key.Map
getAll(Collection colKeys)
Get all the specified keys, if they are in the Map.AbstractBundler
getGetBundler()
Obtain the bundler for the "get" operations.AbstractBundler
getPutBundler()
Obtain the bundler for the "put" operations.AbstractBundler
getRemoveBundler()
Obtain the bundler for the "remove" operations.Object
put(Object oKey, Object oValue)
Associates the specified value with the specified key in this map.void
putAll(Map map)
Copies all of the mappings from the specified map to this map.Object
remove(Object oKey)
Removes the mapping for this key from this map if present.-
Methods inherited from class com.tangosol.net.cache.WrapperNamedCache
addIndex, aggregate, aggregate, destroy, entrySet, entrySet, getCacheName, getCacheService, invoke, invokeAll, invokeAll, isActive, isDestroyed, isReady, isReleased, keySet, put, release, removeIndex, truncate
-
Methods inherited from class com.tangosol.util.WrapperConcurrentMap
clear, getDescription, getLockDescription, getWaitMillis, instantiateLock, isInternalKeySetIteratorMutable, isLockingEnforced, lock, lock, removeBlind, setLockingEnforced, setWaitMillis, toString, unlock
-
Methods inherited from class com.tangosol.util.WrapperObservableMap
addMapListener, addMapListener, addMapListener, containsValue, dispatchEvent, dispatchPendingEvent, ensureInternalListener, ensureMapListenerSupport, equals, getCacheStatistics, getInternalKeySet, getMap, getMapListenerSupport, hashCode, hasListeners, instantiateInternalListener, isCollectStats, isEventFabricator, isSynthetic, isTranslateEvents, removeMapListener, removeMapListener, removeMapListener, setCollectStats, setTranslateEvents
-
Methods inherited from class com.tangosol.util.AbstractKeySetBasedMap
containsKey, instantiateEntrySet, instantiateKeyIterator, instantiateKeySet, instantiateValues, isEmpty, iterateKeys, size
-
Methods inherited from class com.tangosol.util.AbstractKeyBasedMap
clone, entrySet, keySet, values
-
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tangosol.util.ConcurrentMap
containsKey, containsValue, isEmpty, lock, lock, size, unlock
-
Methods inherited from interface com.tangosol.util.InvocableMap
aggregate, compute, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, computeIfPresent, getOrDefault, invokeAll, merge, merge, putIfAbsent, remove, replace, replace, replaceAll, replaceAll, replaceAll, replaceAll, stream, stream, stream, stream, stream, stream
-
Methods inherited from interface com.tangosol.net.NamedMap
clear, getName, getService
-
Methods inherited from interface com.tangosol.util.ObservableMap
addMapListener, addMapListener, addMapListener, removeMapListener, removeMapListener, removeMapListener
-
Methods inherited from interface com.tangosol.util.QueryMap
addIndex, forEach, forEach, values, values
-
Methods inherited from interface com.tangosol.net.Releasable
close
-
-
-
-
Constructor Detail
-
BundlingNamedCache
public BundlingNamedCache(NamedCache cache)
Construct a BundlingNamedCache based on the specified NamedCache.- Parameters:
cache
- the NamedCache that will be wrapped by this BundlingNamedCache
-
-
Method Detail
-
ensureGetBundler
public AbstractBundler ensureGetBundler(int cBundleThreshold)
Configure the bundler for the "get" operations. If the bundler does not exist and bundling is enabled, it will be instantiated.- Parameters:
cBundleThreshold
- the bundle size threshold; pass zero to disable "get" operation bundling- Returns:
- the "get" bundler or null if bundling is disabled
-
ensurePutBundler
public AbstractBundler ensurePutBundler(int cBundleThreshold)
Configure the bundler for the "put" operations. If the bundler does not exist and bundling is enabled, it will be instantiated.- Parameters:
cBundleThreshold
- the bundle size threshold; pass zero to disable "put" operation bundling- Returns:
- the "put" bundler or null if bundling is disabled
-
ensureRemoveBundler
public AbstractBundler ensureRemoveBundler(int cBundleThreshold)
Configure the bundler for the "remove" operations. If the bundler does not exist and bundling is enabled, it will be instantiated.- Parameters:
cBundleThreshold
- the bundle size threshold; pass zero to disable "remove" operation bundling- Returns:
- the "remove" bundler or null if bundling is disabled
-
getGetBundler
public AbstractBundler getGetBundler()
Obtain the bundler for the "get" operations.- Returns:
- the "get" bundler
-
getPutBundler
public AbstractBundler getPutBundler()
Obtain the bundler for the "put" operations.- Returns:
- the "put" bundler
-
getRemoveBundler
public AbstractBundler getRemoveBundler()
Obtain the bundler for the "remove" operations.- Returns:
- the "remove" bundler
-
get
public Object get(Object oKey)
Returns the value to which this map maps the specified key.- Specified by:
get
in interfaceConcurrentMap
- Specified by:
get
in interfaceMap
- Overrides:
get
in classWrapperObservableMap
- Parameters:
oKey
- the key object- Returns:
- the value to which this map maps the specified key, or null if the map contains no mapping for this key
- See Also:
ConcurrentMap.containsKey(Object)
-
getAll
public Map getAll(Collection colKeys)
Get all the specified keys, if they are in the Map. For each key that is in the cache, that key and its corresponding value will be placed in the map that is returned by this method. The absence of a key in the returned map indicates that it was not in the cache, which may imply (for caches that can load behind the scenes) that the requested data could not be loaded.
-
put
public Object put(Object oKey, Object oValue)
Associates the specified value with the specified key in this map.Note: this method always returns null.
- Specified by:
put
in interfaceCacheMap
- Specified by:
put
in interfaceConcurrentMap
- Specified by:
put
in interfaceMap
- Overrides:
put
in classWrapperConcurrentMap
- Parameters:
oKey
- key with which the specified value is to be associatedoValue
- value to be associated with the specified key- Returns:
- previous value associated with specified key, or null if there was no mapping for key
-
putAll
public void putAll(Map map)
Copies all of the mappings from the specified map to this map. The effect of this call is equivalent to that of callingAbstractKeyBasedMap.put(K, V)
on this map once for each mapping in the passed map. The behavior of this operation is unspecified if the passed map is modified while the operation is in progress.- Specified by:
putAll
in interfaceConcurrentMap
- Specified by:
putAll
in interfaceMap
- Overrides:
putAll
in classWrapperConcurrentMap
- Parameters:
map
- the Map containing the key/value pairings to put into this Map
-
remove
public Object remove(Object oKey)
Removes the mapping for this key from this map if present. Expensive: updates both the underlying cache and the local cache.Note: this method always returns null.
- Specified by:
remove
in interfaceConcurrentMap
- Specified by:
remove
in interfaceMap
- Overrides:
remove
in classWrapperConcurrentMap
- Parameters:
oKey
- key whose mapping is to be removed from the map- Returns:
- previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.
-
-