public class ObservableSplittingBackingMap extends WrapperObservableMap implements CacheMap, com.oracle.coherence.common.base.Disposable, PartitionAwareBackingMap
WrapperObservableMap.InternalListener
AbstractKeySetBasedMap.EntrySet, AbstractKeySetBasedMap.KeyIterator, AbstractKeySetBasedMap.KeySet, AbstractKeySetBasedMap.ValuesCollection
AbstractKeyBasedMap.DeferredCacheEvent<K,V>
Base.LoggingWriter, Base.StackFrame
m_fDeferredEvent, m_fTranslateEvents, m_listenerInternal, m_listenerSupport, m_map, m_stats
LOG_ALWAYS, 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
EXPIRY_DEFAULT, EXPIRY_NEVER
Constructor and Description |
---|
ObservableSplittingBackingMap(BackingMapManager bmm,
String sName)
Create a ObservableSplittingBackingMap that will delegate each
partition's data and operations to a separate backing map.
|
ObservableSplittingBackingMap(PartitionAwareBackingMap map)
Create a ObservableSplittingBackingMap that will delegate each
partition's data and operations to a separate backing map.
|
Modifier and Type | Method and Description |
---|---|
void |
addMapListener(MapListener listener,
Filter filter,
boolean fLite)
Add a map listener that receives events based on a filter evaluation.
|
void |
addMapListener(MapListener listener,
Object oKey,
boolean fLite)
Add a map listener for a specific key.
|
void |
createPartition(int nPid)
Add a partition to the PartitionAwareBackingMap.
|
void |
destroyPartition(int nPid)
Remove a partition from the PartitionAwareBackingMap.
|
void |
dispose()
Invoked when all resources owned by the implementer can safely be
released.
|
BackingMapManager |
getBackingMapManager()
Obtain the BackingMapManager that this PartitionAwareBackingMap uses to
instantiate and release backing maps.
|
CacheStatistics |
getCacheStatistics()
Return the CacheStatistics for this cache.
|
String |
getName()
Determine the name of the cache for which this PartitionAwareBackingMap
exists.
|
Map |
getPartitionMap(int nPid)
Obtain a Map view for the data in a specific partition.
|
Map |
getPartitionMap(PartitionSet partitions)
Obtain a Map view for the data in a specific set of partitions.
|
PartitionSplittingBackingMap |
getPartitionSplittingBackingMap()
Obtain the underlying PartitionSplittingBackingMap.
|
boolean |
isCollectStats()
Check whether or not statistics are collected by the wrapper.
|
protected boolean |
isEventFabricator()
Determine if this ObservableMap has to fabricate events itself.
|
protected void |
prepareUpdate(Map mapPart,
Map mapUpdate)
Prepare mapPart, a map representing a partition, for the impending changes
in which all of the mappings from mapUpdate will be copied to mapPart.
|
Object |
put(Object oKey,
Object oValue,
long cMillis)
Associates the specified value with the specified key in this cache.
|
void |
removeMapListener(MapListener listener,
Filter filter)
Remove a map listener that previously signed up for events based on a
filter evaluation.
|
void |
removeMapListener(MapListener listener,
Object oKey)
Remove a map listener that previously signed up for events about a
specific key.
|
void |
setTranslateEvents(boolean fTranslate)
Specify whether or not an event source has to be translated by the
wrapper.
|
String |
toString()
Return a human-readable description for this ObservableSplittingBackingMap.
|
addMapListener, clear, containsValue, dispatchEvent, dispatchPendingEvent, ensureInternalListener, ensureMapListenerSupport, equals, get, getDescription, getInternalKeySet, getMap, getMapListenerSupport, hashCode, hasListeners, instantiateInternalListener, isInternalKeySetIteratorMutable, isSynthetic, isTranslateEvents, put, putAll, remove, removeBlind, removeMapListener, setCollectStats
containsKey, instantiateEntrySet, instantiateKeyIterator, instantiateKeySet, instantiateValues, isEmpty, iterateKeys, size
clone, entrySet, getAll, keySet, values
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, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, 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
finalize, getClass, notify, notifyAll, wait, wait, wait
addMapListener, removeMapListener
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public ObservableSplittingBackingMap(BackingMapManager bmm, String sName)
bmm
- a callback that knows how to create and release the
backing maps that this PartitionSplittingBackingMap is
responsible forsName
- the cache name for which this backing map existspublic ObservableSplittingBackingMap(PartitionAwareBackingMap map)
map
- the PartitionAwareBackingMap to delegate topublic Object put(Object oKey, Object oValue, long cMillis)
CacheMap.put(Object oKey, Object oValue)
method allows the caller to specify an expiry (or "time to live")
for the cache entry.put
in interface CacheMap
oKey
- key with which the specified value is to be associatedoValue
- value to be associated with the specified keycMillis
- the number of milliseconds until the cache entry will
expire, also referred to as the entry's "time to live";
pass CacheMap.EXPIRY_DEFAULT
to use the cache's default
time-to-live setting; pass CacheMap.EXPIRY_NEVER
to
indicate that the cache entry should never expire; this
milliseconds value is not a date/time value, such
as is returned from System.currentTimeMillis()public void addMapListener(MapListener listener, Object oKey, boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the
ObservableMap.removeMapListener(MapListener, Object)
method.
addMapListener
in interface ObservableMap
addMapListener
in class WrapperObservableMap
listener
- the MapEvent
listener to addoKey
- the key that identifies the entry for which to raise
eventsfLite
- true to indicate that the MapEvent
objects do
not have to include the OldValue and NewValue
property values in order to allow optimizationspublic void removeMapListener(MapListener listener, Object oKey)
removeMapListener
in interface ObservableMap
removeMapListener
in class WrapperObservableMap
listener
- the listener to removeoKey
- the key that identifies the entry for which to raise
eventspublic void addMapListener(MapListener listener, Filter filter, boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the
ObservableMap.removeMapListener(MapListener, Filter)
method.
addMapListener
in interface ObservableMap
addMapListener
in class WrapperObservableMap
listener
- the MapEvent
listener to addfilter
- a filter that will be passed MapEvent objects to select
from; a MapEvent will be delivered to the listener only
if the filter evaluates to true for that MapEvent (see
MapEventFilter
);
null is equivalent to a filter that alway returns truefLite
- true to indicate that the MapEvent
objects do
not have to include the OldValue and NewValue
property values in order to allow optimizationspublic void removeMapListener(MapListener listener, Filter filter)
removeMapListener
in interface ObservableMap
removeMapListener
in class WrapperObservableMap
listener
- the listener to removefilter
- the filter that was passed into the corresponding
addMapListener() callpublic BackingMapManager getBackingMapManager()
getBackingMapManager
in interface PartitionAwareBackingMap
public String getName()
getName
in interface PartitionAwareBackingMap
public void createPartition(int nPid)
createPartition
in interface PartitionAwareBackingMap
nPid
- the partition id that the PartitionAwareBackingMap will be
responsible for, starting at this instantpublic void destroyPartition(int nPid)
destroyPartition
in interface PartitionAwareBackingMap
nPid
- the partition id that the PartitionAwareBackingMap will no
longer be responsible for, starting at this instantpublic Map getPartitionMap(int nPid)
getPartitionMap
in interface PartitionAwareBackingMap
nPid
- the partition IDpublic Map getPartitionMap(PartitionSet partitions)
getPartitionMap
in interface PartitionAwareBackingMap
partitions
- the masking PartitionSetpublic void dispose()
Once disposed of the object should no longer be considered to be usable.
Note the Disposable interface is compatible with try-with-resources which will automatically invoke this method.
dispose
in interface com.oracle.coherence.common.base.Disposable
public PartitionSplittingBackingMap getPartitionSplittingBackingMap()
protected boolean isEventFabricator()
isEventFabricator
in class WrapperObservableMap
public void setTranslateEvents(boolean fTranslate)
Note: this setting is only meaningful if the underlying map is an ObservableMap itself.
setTranslateEvents
in class WrapperObservableMap
fTranslate
- true if this wrapper should translate an event
source; false otherwisepublic CacheStatistics getCacheStatistics()
getCacheStatistics
in class WrapperObservableMap
public boolean isCollectStats()
isCollectStats
in class WrapperObservableMap
public String toString()
toString
in class WrapperObservableMap
protected void prepareUpdate(Map mapPart, Map mapUpdate)
mapPart
- the map to be mutated with the contents of mapUpdatemapUpdate
- the map of changes to be applied