|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.net.cache.AbstractCacheLoader
com.tangosol.net.cache.AbstractCacheStore
com.tangosol.net.cache.ReadWriteBackingMap.CacheStoreWrapper
public class ReadWriteBackingMap.CacheStoreWrapper
A wrapper around the original CacheStore to allow operations to be overridden and extended.
Nested Class Summary | |
---|---|
protected class |
ReadWriteBackingMap.CacheStoreWrapper.EraseBundler
|
protected class |
ReadWriteBackingMap.CacheStoreWrapper.LoadBundler
|
protected class |
ReadWriteBackingMap.CacheStoreWrapper.StoreBundler
|
Constructor Summary | |
---|---|
ReadWriteBackingMap.CacheStoreWrapper(CacheStore store)
Construct a wrapped CacheStore. |
Method Summary | |
---|---|
AbstractBundler |
ensureEraseBundler(int cBundleThreshold)
Configure the bundler for the "erase" operations. |
AbstractBundler |
ensureLoadBundler(int cBundleThreshold)
Configure the bundler for the "load" operations. |
AbstractBundler |
ensureStoreBundler(int cBundleThreshold)
Configure the bundler for the "store" operations. |
void |
erase(Object oKey)
Remove the specified key from the underlying store if present. |
void |
eraseAll(Collection colKeys)
Remove the specified keys from the underlying store if present. |
protected void |
eraseAllInternal(Collection colKeys)
Same as eraseAll(java.util.Collection) , but the keys is in the internal format. |
protected void |
eraseInternal(Object oKey)
Same as erase(java.lang.Object) , but the key is in the internal format. |
long |
getAverageBatchSize()
Determine the average number of entries stored per store() operation. |
long |
getAverageEraseMillis()
Determine the average time spent per erase() operation. |
long |
getAverageLoadMillis()
Determine the average time spent per load() operation. |
long |
getAverageStoreMillis()
Determine the average time spent per store() operation. |
CacheStore |
getCacheStore()
The wrapped CacheStore. |
AbstractBundler |
getEraseBundler()
Obtain the bundler for the "erase" operations. |
long |
getEraseFailures()
Determine the number of erase() failures. |
long |
getEraseMillis()
Determine the cummulative time spent on erase() operations. |
long |
getEraseOps()
Determine the number of erase() operations. |
AbstractBundler |
getLoadBundler()
Obtain the bundler for the "load" operations. |
long |
getLoadFailures()
Determine the number of load() failures. |
long |
getLoadMillis()
Determine the cummulative time spent on load() operations. |
long |
getLoadOps()
Determine the number of load() operations. |
AbstractBundler |
getStoreBundler()
Obtain the bundler for the "store" operations. |
long |
getStoreFailures()
Determine the number of store() failures. |
long |
getStoreMillis()
Determine the cummulative time spent on store() operations. |
long |
getStoreOps()
Determine the number of store() operations. |
boolean |
isEraseAllSupported()
Determine if the wrapped CacheStore supports eraseAll() operations. |
boolean |
isEraseSupported()
Determine if the wrapped CacheStore supports erase() operations. |
boolean |
isStoreAllSupported()
Determine if the wrapped CacheStore supports storeAll() operations. |
boolean |
isStoreSupported()
Determine if the wrapped CacheStore supports store() operations. |
Object |
load(Object oKey)
Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store. |
Map |
loadAll(Collection colKeys)
Return the values associated with each the specified keys in the passed collection. |
protected Map |
loadAllInternal(Collection colKeys)
Same as loadAll(java.util.Collection) , but the keys are in the internal format. |
protected Object |
loadInternal(Object oKey)
Same as load(java.lang.Object) , but the key and the returned value are in the
internal format. |
protected void |
onEraseAllFailure(Collection colKeys,
Exception e)
Logs a CacheStore eraseAll() failure. |
protected void |
onEraseFailure(Object oKeyReal,
Exception e)
Logs a CacheStore erase() failure. |
protected void |
onLoadAllFailure(Collection colKeys,
Exception e)
Logs a CacheStore loadAll() failure. |
protected void |
onLoadFailure(Object oKeyReal,
Exception e)
Logs a CacheStore load() failure. |
protected void |
onStoreAllFailure(Map mapEntries,
Exception e)
Logs a CacheStore storeAll() failure. |
protected void |
onStoreFailure(Object oKeyReal,
Object oValueReal,
Exception e)
Logs a CacheStore store() failure. |
protected void |
replaceInternal(Object oKey,
Object oValueOld,
Object oValueNew)
Replace the value in the internal cache with a new one iff it is currently mapped to the given value. |
void |
resetStatistics()
Reset the CacheStore statistics. |
void |
setEraseAllSupported(boolean fSupported)
Set the flag that determines whether or not the wrapped CacheStore supports eraseAll() operations. |
void |
setEraseSupported(boolean fSupported)
Set the flag that determines whether or not the wrapped CacheStore supports erase() operations. |
void |
setStoreAllSupported(boolean fSupported)
Set the flag that determines whether or not the wrapped CacheStore supports storeAll() operations. |
void |
setStoreSupported(boolean fSupported)
Set the flag that determines whether or not the wrapped CacheStore supports store() operations. |
void |
store(Object oKey,
Object oValue)
Store the specified value under the specified key in the underlying store. |
void |
storeAll(Map mapEntries)
Store the specified values under the specified keys in the underlying store. |
protected void |
storeAllInternal(Map mapEntries)
Same as storeAll(java.util.Map) , but the entries are in the internal format. |
protected void |
storeInternal(Object oKey,
Object oValue)
Same as store(java.lang.Object, java.lang.Object) , but the key and value are in the internal format. |
String |
toString()
Return a String representation of the CacheStoreWrapper object that will be used as a part of the write-behind thread name. |
Constructor Detail |
---|
public ReadWriteBackingMap.CacheStoreWrapper(CacheStore store)
store
- the CacheStore to wrapMethod Detail |
---|
public AbstractBundler ensureLoadBundler(int cBundleThreshold)
cBundleThreshold
- the bundle size threshold; pass zero to
disable "load" operation bundling
public AbstractBundler ensureStoreBundler(int cBundleThreshold)
cBundleThreshold
- the bundle size threshold; pass zero to
disable "store" operation bundling
public AbstractBundler ensureEraseBundler(int cBundleThreshold)
cBundleThreshold
- the bundle size threshold; pass zero to
disable "erase" operation bundling
public AbstractBundler getLoadBundler()
public AbstractBundler getStoreBundler()
public AbstractBundler getEraseBundler()
protected Object loadInternal(Object oKey)
load(java.lang.Object)
, but the key and the returned value are in the
internal format.
protected Map loadAllInternal(Collection colKeys)
loadAll(java.util.Collection)
, but the keys are in the internal format.
protected void storeInternal(Object oKey, Object oValue)
store(java.lang.Object, java.lang.Object)
, but the key and value are in the internal format.
protected void storeAllInternal(Map mapEntries)
storeAll(java.util.Map)
, but the entries are in the internal format.
protected void eraseInternal(Object oKey)
erase(java.lang.Object)
, but the key is in the internal format.
protected void eraseAllInternal(Collection colKeys)
eraseAll(java.util.Collection)
, but the keys is in the internal format.
protected void replaceInternal(Object oKey, Object oValueOld, Object oValueNew)
public Object load(Object oKey)
load
in interface CacheLoader
load
in class AbstractCacheLoader
oKey
- key whose associated value is to be returned
public Map loadAll(Collection colKeys)
loadAll
in interface CacheLoader
loadAll
in class AbstractCacheLoader
colKeys
- a collection of keys to load
public void store(Object oKey, Object oValue)
store
in interface CacheStore
store
in class AbstractCacheStore
oKey
- key to store the value underoValue
- value to be storedpublic void storeAll(Map mapEntries)
The implementation of this method calls AbstractCacheStore.store(java.lang.Object, java.lang.Object)
for each entry in
the supplied Map. Once stored successfully, an entry is removed from
the Map (if possible).
Note: For many types of persistent stores, a single store operation is as expensive as a bulk store operation; therefore, subclasses should override this method if possible.
storeAll
in interface CacheStore
storeAll
in class AbstractCacheStore
mapEntries
- a Map of any number of keys and values to storepublic void erase(Object oKey)
erase
in interface CacheStore
erase
in class AbstractCacheStore
oKey
- key whose mapping is being removed from the cachepublic void eraseAll(Collection colKeys)
The implementation of this method calls AbstractCacheStore.erase(java.lang.Object)
for each key in
the supplied Collection. Once erased successfully, a key is removed from
the Collection (if possible).
Note: For many types of persistent stores, a single erase operation is as expensive as a bulk erase operation; therefore, subclasses should override this method if possible.
eraseAll
in interface CacheStore
eraseAll
in class AbstractCacheStore
colKeys
- keys whose mappings are being removed from the cachepublic long getLoadOps()
public long getLoadFailures()
public long getLoadMillis()
public long getStoreOps()
public long getStoreFailures()
public long getStoreMillis()
public long getEraseOps()
public long getEraseFailures()
public long getEraseMillis()
public long getAverageBatchSize()
public long getAverageLoadMillis()
public long getAverageStoreMillis()
public long getAverageEraseMillis()
public void resetStatistics()
public CacheStore getCacheStore()
public boolean isStoreSupported()
public void setStoreSupported(boolean fSupported)
fSupported
- the new value of the flagpublic boolean isStoreAllSupported()
public void setStoreAllSupported(boolean fSupported)
fSupported
- the new value of the flagpublic boolean isEraseSupported()
public void setEraseSupported(boolean fSupported)
fSupported
- the new value of the flagpublic boolean isEraseAllSupported()
public void setEraseAllSupported(boolean fSupported)
fSupported
- the new value of the flagprotected void onLoadFailure(Object oKeyReal, Exception e)
oKeyReal
- the keye
- the exceptionprotected void onLoadAllFailure(Collection colKeys, Exception e)
colKeys
- colKeys a collection of keys in external form to loade
- the exceptionprotected void onStoreFailure(Object oKeyReal, Object oValueReal, Exception e)
oKeyReal
- the keyoValueReal
- the valuee
- the exceptionprotected void onStoreAllFailure(Map mapEntries, Exception e)
mapEntries
- a Map of entries in external forme
- the exceptionprotected void onEraseFailure(Object oKeyReal, Exception e)
oKeyReal
- the keye
- the exceptionprotected void onEraseAllFailure(Collection colKeys, Exception e)
colKeys
- keys whose mappings are being removed from the cachee
- the exceptionpublic String toString()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |