|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.2) E26043-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.AbstractKeyBasedMap
com.tangosol.util.AbstractKeySetBasedMap
com.tangosol.util.WrapperObservableMap
com.tangosol.net.partition.ObservableSplittingBackingMap
com.tangosol.net.partition.ObservableSplittingBackingCache
public class ObservableSplittingBackingCache
The ObservableSplittingBackingCache is an implementation of the ConfigurableCacheMap interface that works as an observable backing map in a partitioned system. In other words, it acts like a LocalCache, but it internally partitions its data across any number of caches that implement the ConfigurableCacheMap interface. Note that the underlying backing maps must implement the ConfigurableCacheMap interface or a runtime exception will occur.
| Nested Class Summary | |
|---|---|
class |
ObservableSplittingBackingCache.EntrySetA set of ConfigurableCacheMap entries backed by this map. |
| Nested classes/interfaces inherited from class com.tangosol.util.WrapperObservableMap |
|---|
WrapperObservableMap.InternalListener |
| Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeySetBasedMap |
|---|
AbstractKeySetBasedMap.KeyIterator, AbstractKeySetBasedMap.KeySet, AbstractKeySetBasedMap.ValuesCollection |
| Nested classes/interfaces inherited from interface com.tangosol.net.cache.ConfigurableCacheMap |
|---|
ConfigurableCacheMap.Entry, ConfigurableCacheMap.EvictionApprover, ConfigurableCacheMap.EvictionPolicy, ConfigurableCacheMap.UnitCalculator |
| Field Summary | |
|---|---|
protected ConfigurableCacheMap[] |
m_acacheA cached array of the backing ConfigurableCacheMap instances. |
protected ConfigurableCacheMap.EvictionApprover |
m_apprvrEvictAn optional EvictionApprover registered with this cache. |
protected ConfigurableCacheMap.UnitCalculator |
m_calculatorThe unit calculator. |
protected int |
m_cExpiryDelayMillisThe expiry delay. |
protected int |
m_cHighUnitsHigh units is the number of units that triggers eviction. |
protected int |
m_cLowUnitsLow units is the number of units to evict down to. |
protected int |
m_nUnitFactorThe unit factor. |
protected ConfigurableCacheMap.EvictionPolicy |
m_policyThe eviction policy. |
protected static int |
PROP_HIGH_UNITSThe "HighUnits" property. |
protected static int |
PROP_LOW_UNITSThe "LowUnits" property. |
protected static int |
PROP_UNITSThe "Units" property. |
| Fields inherited from class com.tangosol.util.WrapperObservableMap |
|---|
m_fDeferredEvent, m_fTranslateEvents, m_listenerInternal, m_listenerSupport, m_map, m_stats |
| Fields inherited from interface com.tangosol.net.cache.CacheMap |
|---|
EXPIRY_DEFAULT, EXPIRY_NEVER |
| Constructor Summary | |
|---|---|
ObservableSplittingBackingCache(BackingMapManager bmm, java.lang.String sName)Create a ObservableSplittingBackingCache that adds ConfigurableCacheMap functionality to an ObservableSplittingBackingMap. |
|
| Method Summary | |
|---|---|
protected int |
calculateUnits(int nProp)Aggregate the number of units across all of the partition backing maps. |
void |
createPartition(int nPid)Add a partition to the PartitionAwareBackingMap. |
void |
destroyPartition(int nPid)Remove a partition from the PartitionAwareBackingMap. |
void |
evict()Evict all entries from the cache that are no longer valid, and potentially prune the cache size if the cache is size-limited and its size is above the caching low water mark. |
void |
evict(java.lang.Object oKey)Evict a specified key from the cache, as if it had expired from the cache. |
void |
evictAll(java.util.Collection colKeys)Evict the specified keys from the cache, as if they had each expired from the cache. |
ConfigurableCacheMap.Entry |
getCacheEntry(java.lang.Object oKey)Locate a cache Entry in the cache based on its key. |
ConfigurableCacheMap.EvictionApprover |
getEvictionApprover()Obtain the registered EvictionApprover. |
ConfigurableCacheMap.EvictionPolicy |
getEvictionPolicy()Obtain the current EvictionPolicy used by the cache. |
int |
getExpiryDelay()Determine the default "time to live" for each individual cache entry. |
protected ConfigurableCacheMap |
getFirstPartitionCache()Obtain the first one of the backing caches. |
int |
getHighUnits()Determine the limit of the cache size in units. |
int |
getLowUnits()Determine the point to which the cache will shrink when it prunes. |
protected ConfigurableCacheMap |
getPartitionCache(java.lang.Object oKey)Obtain the backing cache for a particular key. |
protected ConfigurableCacheMap[] |
getPartitionCacheArray()Obtain the array of backing caches. |
ConfigurableCacheMap.UnitCalculator |
getUnitCalculator()Obtain the current UnitCalculator used by the cache. |
int |
getUnitFactor()Determine the factor by which the Units, LowUnits and HighUnits properties are adjusted. |
int |
getUnits()Determine the number of units that the cache currently stores. |
protected void |
initializeConfiguredProperties()Initialize the configurable properties of this cache-map. |
protected java.util.Set |
instantiateEntrySet()Factory pattern: Create a Set that represents the entries in the Map. |
protected void |
partitionUnits(int nProp)Partition out the high or low units across all of the backing maps. |
protected void |
repartition()Repartition the units across the backing maps. |
void |
setEvictionApprover(ConfigurableCacheMap.EvictionApprover approver)Set the EvictionApprover for this ConfigurableCacheMap. |
void |
setEvictionPolicy(ConfigurableCacheMap.EvictionPolicy policy)Set the EvictionPolicy for the cache to use. |
void |
setExpiryDelay(int cMillis)Specify the default "time to live" for cache entries. |
void |
setHighUnits(int cMax)Update the maximum size of the cache in units. |
void |
setLowUnits(int cUnits)Specify the point to which the cache will shrink when it prunes. |
void |
setUnitCalculator(ConfigurableCacheMap.UnitCalculator calculator)Set the UnitCalculator for the cache to use. |
void |
setUnitFactor(int nFactor)Determine the factor by which the Units, LowUnits and HighUnits properties are adjusted. |
| Methods inherited from class com.tangosol.net.partition.ObservableSplittingBackingMap |
|---|
addMapListener, addMapListener, getBackingMapManager, getCacheStatistics, getName, getPartitionMap, getPartitionMap, getPartitionSplittingBackingMap, isCollectStats, isEventFabricator, put, removeMapListener, removeMapListener, setTranslateEvents, toString |
| Methods inherited from class com.tangosol.util.WrapperObservableMap |
|---|
addMapListener, clear, containsValue, dispatchEvent, dispatchPendingEvent, ensureInternalListener, ensureMapListenerSupport, get, getDescription, getInternalKeySet, getMap, getMapListenerSupport, hasListeners, instantiateInternalListener, isInternalKeySetIteratorMutable, isSynthetic, isTranslateEvents, put, putAll, remove, removeBlind, removeMapListener, setCollectStats |
| Methods inherited from class com.tangosol.util.AbstractKeySetBasedMap |
|---|
containsKey, instantiateKeyIterator, instantiateKeySet, instantiateValues, isEmpty, iterateKeys, size |
| Methods inherited from class com.tangosol.util.AbstractKeyBasedMap |
|---|
clone, entrySet, equals, getAll, hashCode, keySet, values |
| Methods inherited from interface com.tangosol.net.cache.CacheMap |
|---|
getAll, put, put |
| Methods inherited from interface com.tangosol.util.ObservableMap |
|---|
addMapListener, addMapListener, addMapListener, removeMapListener, removeMapListener, removeMapListener |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, values |
| Field Detail |
|---|
protected static final int PROP_UNITS
protected static final int PROP_HIGH_UNITS
protected static final int PROP_LOW_UNITS
protected int m_cHighUnits
protected int m_cLowUnits
protected int m_nUnitFactor
protected int m_cExpiryDelayMillis
protected ConfigurableCacheMap.EvictionPolicy m_policy
protected ConfigurableCacheMap.UnitCalculator m_calculator
protected ConfigurableCacheMap[] m_acache
protected ConfigurableCacheMap.EvictionApprover m_apprvrEvict
| Constructor Detail |
|---|
public ObservableSplittingBackingCache(BackingMapManager bmm,
java.lang.String sName)
bmm - a callback that knows how to create and release the backing maps that this ObservableSplittingBackingCache is responsible forsName - the cache name for which this backing map exists| Method Detail |
|---|
public void createPartition(int nPid)
createPartition in interface PartitionAwareBackingMapcreatePartition in class ObservableSplittingBackingMapnPid - the partition id that the PartitionAwareBackingMap will be responsible for, starting at this instantpublic void destroyPartition(int nPid)
destroyPartition in interface PartitionAwareBackingMapdestroyPartition in class ObservableSplittingBackingMapnPid - the partition id that the PartitionAwareBackingMap will no longer be responsible for, starting at this instantpublic int getUnits()
Note: It is expected that the return type will be widened to a long in Coherence 4.
getUnits in interface ConfigurableCacheMappublic int getHighUnits()
Note: It is expected that the return type will be widened to a long in Coherence 4.
getHighUnits in interface ConfigurableCacheMappublic void setHighUnits(int cMax)
Note: It is expected that the parameter will be widened to a long in Coherence 4.
setHighUnits in interface ConfigurableCacheMapcMax - the new maximum size of the cache, in unitspublic int getLowUnits()
Note: It is expected that the parameter will be widened to a long in Coherence 4.
getLowUnits in interface ConfigurableCacheMappublic void setLowUnits(int cUnits)
Note: It is expected that the parameter will be widened to a long in Coherence 4.
setLowUnits in interface ConfigurableCacheMapcUnits - the number of units that the cache prunes topublic int getUnitFactor()
Note: This property exists only to avoid changing the type of the units, low units and high units properties from 32-bit values to 64-bit values. It is expected that the parameter will be dropped in Coherence 4.
getUnitFactor in interface ConfigurableCacheMappublic void setUnitFactor(int nFactor)
Note: This property exists only to avoid changing the type of the units, low units and high units properties from 32-bit values to 64-bit values. It is expected that the parameter will be dropped in Coherence 4.
setUnitFactor in interface ConfigurableCacheMapnFactor - the units factor; the default is 1public ConfigurableCacheMap.EvictionPolicy getEvictionPolicy()
getEvictionPolicy in interface ConfigurableCacheMappublic void setEvictionPolicy(ConfigurableCacheMap.EvictionPolicy policy)
setEvictionPolicy in interface ConfigurableCacheMappolicy - an EvictionPolicypublic void evict(java.lang.Object oKey)
evict in interface ConfigurableCacheMapoKey - the key to evict from the cachepublic void evictAll(java.util.Collection colKeys)
The result of this method is defined to be semantically the same as the following implementation:
for (Iterator iter = colKeys.iterator(); iter.hasNext(); )
{
Object oKey = iter.next();
evict(oKey);
}
evictAll in interface ConfigurableCacheMapcolKeys - a collection of keys to evict from the cachepublic void evict()
evict in interface ConfigurableCacheMappublic ConfigurableCacheMap.EvictionApprover getEvictionApprover()
getEvictionApprover in interface ConfigurableCacheMappublic void setEvictionApprover(ConfigurableCacheMap.EvictionApprover approver)
setEvictionApprover in interface ConfigurableCacheMapapprover - the EvictionApproverpublic int getExpiryDelay()
getExpiryDelay in interface ConfigurableCacheMappublic void setExpiryDelay(int cMillis)
setExpiryDelay in interface ConfigurableCacheMapcMillis - the number of milliseconds that cache entries will live, or zero to disable automatic expirypublic ConfigurableCacheMap.Entry getCacheEntry(java.lang.Object oKey)
getCacheEntry in interface ConfigurableCacheMapoKey - the key object to search forpublic ConfigurableCacheMap.UnitCalculator getUnitCalculator()
getUnitCalculator in interface ConfigurableCacheMappublic void setUnitCalculator(ConfigurableCacheMap.UnitCalculator calculator)
setUnitCalculator in interface ConfigurableCacheMapcalculator - a UnitCalculatorprotected void initializeConfiguredProperties()
protected ConfigurableCacheMap getPartitionCache(java.lang.Object oKey)
oKey - the key of the desired entryprotected ConfigurableCacheMap getFirstPartitionCache()
protected ConfigurableCacheMap[] getPartitionCacheArray()
protected void repartition()
protected int calculateUnits(int nProp)
nProp - one of the PROP_* values that specifies whether to aggregate the Units, HighUnits or LowUnits propertyprotected void partitionUnits(int nProp)
nProp - either PROP_HIGH_UNITS or PROP_LOW_UNITS which specifies whether this is going to partition out the high or the low unitsprotected java.util.Set instantiateEntrySet()
instantiateEntrySet in class AbstractKeySetBasedMap
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.2) E26043-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||