public abstract class AbstractCacheRecordStore<R extends CacheRecord,CRM extends CacheRecordMap<Data,R>> extends Object implements ICacheRecordStore
| Modifier and Type | Field and Description | 
|---|---|
protected Map<CacheEventType,Set<CacheEventData>> | 
batchEvent  | 
protected CacheConfig | 
cacheConfig  | 
protected javax.cache.integration.CacheLoader | 
cacheLoader  | 
protected AbstractCacheService | 
cacheService  | 
protected javax.cache.integration.CacheWriter | 
cacheWriter  | 
protected static int | 
DEFAULT_INITIAL_CAPACITY  | 
protected javax.cache.expiry.ExpiryPolicy | 
defaultExpiryPolicy  | 
protected boolean | 
evictionEnabled  | 
protected int | 
evictionPercentage  | 
protected EvictionPolicy | 
evictionPolicy  | 
protected int | 
evictionThresholdPercentage  | 
protected boolean | 
hasExpiringEntry  | 
protected boolean | 
isEventBatchingEnabled  | 
protected boolean | 
isEventsEnabled  | 
protected String | 
name  | 
protected NodeEngine | 
nodeEngine  | 
protected int | 
partitionId  | 
protected CRM | 
records  | 
protected CacheStatisticsImpl | 
statistics  | 
MIN_FORCED_EVICT_PERCENTAGE, ONE_HUNDRED_PERCENT| Constructor and Description | 
|---|
AbstractCacheRecordStore(String name,
                        int partitionId,
                        NodeEngine nodeEngine,
                        AbstractCacheService cacheService)  | 
| Modifier and Type | Method and Description | 
|---|---|
R | 
accessRecord(R record,
            javax.cache.expiry.ExpiryPolicy expiryPolicy,
            long now)  | 
void | 
clear()
clears all internal data without publishing any events 
 | 
protected boolean | 
compare(Object v1,
       Object v2)  | 
boolean | 
contains(Data key)
Determines if this store contains an entry for the specified key. 
 | 
protected abstract CacheEntryProcessorEntry | 
createCacheEntryProcessorEntry(Data key,
                              R record,
                              long now)  | 
protected R | 
createRecord(Data keyData,
            Object value,
            long expirationTime)  | 
protected R | 
createRecord(long expiryTime)  | 
protected R | 
createRecord(Object value,
            long expiryTime)  | 
protected abstract <T> R | 
createRecord(T value,
            long creationTime,
            long expiryTime)  | 
protected abstract CRM | 
createRecordCacheMap()  | 
R | 
createRecordWithExpiry(Data key,
                      Object value,
                      javax.cache.expiry.ExpiryPolicy expiryPolicy,
                      long now,
                      boolean disableWriteThrough)  | 
protected abstract R | 
dataToRecord(Data data)  | 
protected abstract <T> T | 
dataToValue(Data data)  | 
protected void | 
deleteAllCacheEntry(Set<Data> keys)  | 
protected void | 
deleteCacheEntry(Data key)  | 
protected boolean | 
deleteRecord(Data key)  | 
int | 
evictExpiredRecords(int percentage)
Evict cache record store as  
evictionPercentange. | 
int | 
evictIfRequired()
Evict cache record store if eviction is required. 
 | 
protected long | 
expiryPolicyToTTL(javax.cache.expiry.ExpiryPolicy expiryPolicy)  | 
int | 
forceEvict()
Forcibly evict all expired records. 
 | 
Object | 
get(Data key,
   javax.cache.expiry.ExpiryPolicy expiryPolicy)
Gets the value to which the specified key is mapped,
 or  
null if this cache contains no mapping for the key. | 
MapEntrySet | 
getAll(Set<Data> keySet,
      javax.cache.expiry.ExpiryPolicy expiryPolicy)
Gets a collection of entries from the store, returning them as
  
Map of the values associated with the set of keys requested. | 
Object | 
getAndPut(Data key,
         Object value,
         javax.cache.expiry.ExpiryPolicy expiryPolicy,
         String caller)
Associates the specified value with the specified key in this cache,
 returning an existing value if one existed. 
 | 
protected Object | 
getAndPut(Data key,
         Object value,
         javax.cache.expiry.ExpiryPolicy expiryPolicy,
         String caller,
         boolean getValue)  | 
protected Object | 
getAndPut(Data key,
         Object value,
         javax.cache.expiry.ExpiryPolicy expiryPolicy,
         String caller,
         boolean getValue,
         boolean disableWriteThrough)  | 
Object | 
getAndRemove(Data key,
            String caller)
Atomically removes the entry for a key only if it is currently mapped to some
 value. 
 | 
Object | 
getAndReplace(Data key,
             Object value,
             javax.cache.expiry.ExpiryPolicy expiryPolicy,
             String caller)
Atomically replaces the value for a given key if and only if there is a
 value currently mapped by the key. 
 | 
CacheStatisticsImpl | 
getCacheStats()
Gets the Cache statistics associated with this  
CacheService. | 
CacheConfig | 
getConfig()
Gets the configuration of the cache that this store belongs to. 
 | 
protected javax.cache.expiry.ExpiryPolicy | 
getExpiryPolicy(javax.cache.expiry.ExpiryPolicy expiryPolicy)  | 
String | 
getName()
Gets the name of the distributed object name of the cache. 
 | 
Map<Data,CacheRecord> | 
getReadOnlyRecords()
Returns a readonly map of the internal key value store. 
 | 
CacheRecord | 
getRecord(Data key)
Gets internal record of the store by key. 
 | 
Object | 
invoke(Data key,
      javax.cache.processor.EntryProcessor entryProcessor,
      Object[] arguments)
Invokes an  
EntryProcessor against the Cache.Entry specified by
 the provided key. | 
protected abstract boolean | 
isEvictionRequired()  | 
protected boolean | 
isReadThrough()  | 
protected boolean | 
isStatisticsEnabled()  | 
protected boolean | 
isWriteThrough()  | 
CacheKeyIteratorResult | 
iterator(int tableIndex,
        int size)
Starting from the provided table index, a set of keys are returned with a maximum size of  
size | 
Set<Data> | 
loadAll(Set<Data> keys,
       boolean replaceExistingValues)
Synchronously loads the specified entries into the cache using the
 configured  
CacheLoader for the given keys. | 
protected Map<Data,Object> | 
loadAllCacheEntry(Set<Data> keys)  | 
protected void | 
onAfterGetAndPut(Data key,
                Object value,
                javax.cache.expiry.ExpiryPolicy expiryPolicy,
                String caller,
                boolean getValue,
                boolean disableWriteThrough,
                R record,
                Object oldValue,
                boolean isExpired,
                boolean isNewPut,
                boolean isSaveSucceed)  | 
protected void | 
onAfterGetAndReplace(Data key,
                    Object oldValue,
                    Object newValue,
                    javax.cache.expiry.ExpiryPolicy expiryPolicy,
                    String caller,
                    boolean getValue,
                    R record,
                    boolean isExpired,
                    boolean replaced)  | 
protected void | 
onAfterPutIfAbsent(Data key,
                  Object value,
                  javax.cache.expiry.ExpiryPolicy expiryPolicy,
                  String caller,
                  boolean disableWriteThrough,
                  R record,
                  boolean isExpired,
                  boolean isSaveSucceed)  | 
protected void | 
onAfterUpdateRecord(Data key,
                   R record,
                   Object value,
                   Data oldDataValue)  | 
protected void | 
onBeforeGetAndPut(Data key,
                 Object value,
                 javax.cache.expiry.ExpiryPolicy expiryPolicy,
                 String caller,
                 boolean getValue,
                 boolean disableWriteThrough,
                 R record,
                 Object oldValue,
                 boolean isExpired,
                 boolean willBeNewPut)  | 
protected void | 
onBeforeGetAndReplace(Data key,
                     Object oldValue,
                     Object newValue,
                     javax.cache.expiry.ExpiryPolicy expiryPolicy,
                     String caller,
                     boolean getValue,
                     R record,
                     boolean isExpired)  | 
protected void | 
onBeforePutIfAbsent(Data key,
                   Object value,
                   javax.cache.expiry.ExpiryPolicy expiryPolicy,
                   String caller,
                   boolean disableWriteThrough,
                   R record,
                   boolean isExpired)  | 
protected void | 
onBeforeUpdateRecord(Data key,
                    R record,
                    Object value,
                    Data oldDataValue)  | 
protected void | 
onDeleteRecord(Data key,
              R record,
              Data dataValue,
              boolean deleted)  | 
protected void | 
onDeleteRecordError(Data key,
                   R record,
                   Data dataValue,
                   Throwable error)  | 
protected void | 
onGet(Data key,
     javax.cache.expiry.ExpiryPolicy expiryPolicy,
     Object value,
     R record)  | 
protected void | 
onGetAndPutError(Data key,
                Object value,
                javax.cache.expiry.ExpiryPolicy expiryPolicy,
                String caller,
                boolean getValue,
                boolean disableWriteThrough,
                R record,
                Object oldValue,
                boolean wouldBeNewPut,
                Throwable error)  | 
protected void | 
onPutIfAbsentError(Data key,
                  Object value,
                  javax.cache.expiry.ExpiryPolicy expiryPolicy,
                  String caller,
                  boolean disableWriteThrough,
                  R record,
                  Throwable error)  | 
protected void | 
onRemove(Data key,
        Object value,
        String caller,
        boolean getValue,
        R record,
        boolean removed)  | 
protected void | 
onUpdateRecordError(Data key,
                   R record,
                   Object value,
                   Data newDataValue,
                   Data oldDataValue,
                   Throwable error)  | 
boolean | 
processExpiredEntry(Data key,
                   R record,
                   long now)  | 
R | 
processExpiredEntry(Data key,
                   R record,
                   long expiryTime,
                   long now)  | 
protected void | 
publishBatchedEvents(String cacheName,
                    CacheEventType cacheEventType,
                    int orderKey)  | 
void | 
publishCompletedEvent(String cacheName,
                     int completionId,
                     Data dataKey,
                     int orderKey)
Publish a Completion Event. 
 | 
protected void | 
publishEvent(String cacheName,
            CacheEventType eventType,
            Data dataKey,
            Data dataOldValue,
            Data dataValue,
            boolean isOldValueAvailable)  | 
void | 
put(Data key,
   Object value,
   javax.cache.expiry.ExpiryPolicy expiryPolicy,
   String caller)
Associates the specified value with the specified key in this cache,
 returning an existing value if one existed. 
 | 
boolean | 
putIfAbsent(Data key,
           Object value,
           javax.cache.expiry.ExpiryPolicy expiryPolicy,
           String caller)
Removes the mapping for a key from this cache if it is present. 
 | 
protected boolean | 
putIfAbsent(Data key,
           Object value,
           javax.cache.expiry.ExpiryPolicy expiryPolicy,
           String caller,
           boolean disableWriteThrough)  | 
Object | 
readThroughCache(Data key)  | 
R | 
readThroughRecord(Data key,
                 long now)  | 
protected abstract Data | 
recordToData(R record)  | 
protected abstract <T> T | 
recordToValue(R record)  | 
boolean | 
remove(Data key,
      Object value,
      String caller)
Atomically removes the mapping for a key only if currently mapped to the
 given value. 
 | 
boolean | 
remove(Data key,
      String caller)
Removes the mapping for a key from this cache if it is present. 
 | 
void | 
removeAll(Set<Data> keys)
records of keys will be deleted one by one and will publish a REMOVE event
 for each key. 
 | 
CacheRecord | 
removeRecord(Data key)
Removes the record for a key. 
 | 
boolean | 
replace(Data key,
       Object value,
       javax.cache.expiry.ExpiryPolicy expiryPolicy,
       String caller)
Atomically replaces the entry for a key only if currently mapped to some
 value. 
 | 
boolean | 
replace(Data key,
       Object oldValue,
       Object newValue,
       javax.cache.expiry.ExpiryPolicy expiryPolicy,
       String caller)
Atomically replaces the entry for a key only if currently mapped to a
 given value. 
 | 
void | 
setRecord(Data key,
         CacheRecord record)
Associates the specified record with the specified key. 
 | 
int | 
size()
Calculates the entry size of this store which reflects the partition size of the cache. 
 | 
protected Data | 
toData(Object obj)  | 
protected Data | 
toEventData(Object obj)  | 
protected abstract Data | 
toHeapData(Object obj)  | 
protected R | 
toRecord(Object obj)  | 
protected <T> T | 
toValue(Object obj)  | 
protected javax.cache.expiry.ExpiryPolicy | 
ttlToExpirePolicy(long ttl)  | 
protected long | 
updateAccessDuration(CacheRecord record,
                    javax.cache.expiry.ExpiryPolicy expiryPolicy,
                    long now)  | 
protected void | 
updateGetAndPutStat(boolean isPutSucceed,
                   boolean getValue,
                   boolean oldValueNull,
                   long start)  | 
protected void | 
updateHasExpiringEntry(R record)  | 
protected R | 
updateRecord(Data key,
            R record,
            Object value)  | 
boolean | 
updateRecordWithExpiry(Data key,
                      Object value,
                      R record,
                      javax.cache.expiry.ExpiryPolicy expiryPolicy,
                      long now,
                      boolean disableWriteThrough)  | 
protected void | 
updateReplaceStat(boolean result,
                 boolean isHit,
                 long start)  | 
protected abstract <T> Data | 
valueToData(T value)  | 
protected abstract <T> R | 
valueToRecord(T value)  | 
void | 
writeThroughCache(Data key,
                 Object value)  | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroyprotected static final int DEFAULT_INITIAL_CAPACITY
protected final String name
protected final int partitionId
protected final NodeEngine nodeEngine
protected final AbstractCacheService cacheService
protected final CacheConfig cacheConfig
protected CRM extends CacheRecordMap<Data,R> records
protected CacheStatisticsImpl statistics
protected javax.cache.integration.CacheLoader cacheLoader
protected javax.cache.integration.CacheWriter cacheWriter
protected boolean isEventsEnabled
protected boolean isEventBatchingEnabled
protected javax.cache.expiry.ExpiryPolicy defaultExpiryPolicy
protected final EvictionPolicy evictionPolicy
protected volatile boolean hasExpiringEntry
protected final boolean evictionEnabled
protected final int evictionPercentage
protected final int evictionThresholdPercentage
protected final Map<CacheEventType,Set<CacheEventData>> batchEvent
public AbstractCacheRecordStore(String name, int partitionId, NodeEngine nodeEngine, AbstractCacheService cacheService)
protected boolean isReadThrough()
protected boolean isWriteThrough()
protected boolean isStatisticsEnabled()
protected abstract CRM createRecordCacheMap()
protected abstract CacheEntryProcessorEntry createCacheEntryProcessorEntry(Data key, R record, long now)
protected abstract <T> R createRecord(T value, long creationTime, long expiryTime)
protected abstract <T> Data valueToData(T value)
protected abstract <T> T dataToValue(Data data)
protected abstract <T> R valueToRecord(T value)
protected abstract <T> T recordToValue(R record)
protected abstract boolean isEvictionRequired()
protected void updateHasExpiringEntry(R record)
public int evictIfRequired()
ICacheRecordStoreEviction logic is handled as specified EvictionPolicy
 in CacheConfig for this record store
evictIfRequired in interface ICacheRecordStorepublic int evictExpiredRecords(int percentage)
ICacheRecordStoreevictionPercentange.
 Eviction logic is handled as specified EvictionPolicy
 in CacheConfig for this record store
evictExpiredRecords in interface ICacheRecordStorepercentage - The eviction percentage relative to cache record store capacity.public int forceEvict()
ICacheRecordStoreforceEvict in interface ICacheRecordStoreprotected <T> T toValue(Object obj)
protected javax.cache.expiry.ExpiryPolicy getExpiryPolicy(javax.cache.expiry.ExpiryPolicy expiryPolicy)
public R accessRecord(R record, javax.cache.expiry.ExpiryPolicy expiryPolicy, long now)
protected void updateGetAndPutStat(boolean isPutSucceed,
                       boolean getValue,
                       boolean oldValueNull,
                       long start)
protected long updateAccessDuration(CacheRecord record, javax.cache.expiry.ExpiryPolicy expiryPolicy, long now)
protected void updateReplaceStat(boolean result,
                     boolean isHit,
                     long start)
protected void publishEvent(String cacheName, CacheEventType eventType, Data dataKey, Data dataOldValue, Data dataValue, boolean isOldValueAvailable)
protected void publishBatchedEvents(String cacheName, CacheEventType cacheEventType, int orderKey)
protected long expiryPolicyToTTL(javax.cache.expiry.ExpiryPolicy expiryPolicy)
protected javax.cache.expiry.ExpiryPolicy ttlToExpirePolicy(long ttl)
protected R createRecord(long expiryTime)
public R createRecordWithExpiry(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, long now, boolean disableWriteThrough)
protected void onBeforeUpdateRecord(Data key, R record, Object value, Data oldDataValue)
protected void onAfterUpdateRecord(Data key, R record, Object value, Data oldDataValue)
protected void onUpdateRecordError(Data key, R record, Object value, Data newDataValue, Data oldDataValue, Throwable error)
public boolean updateRecordWithExpiry(Data key, Object value, R record, javax.cache.expiry.ExpiryPolicy expiryPolicy, long now, boolean disableWriteThrough)
protected void onDeleteRecordError(Data key, R record, Data dataValue, Throwable error)
protected boolean deleteRecord(Data key)
public Object readThroughCache(Data key) throws javax.cache.integration.CacheLoaderException
javax.cache.integration.CacheLoaderExceptionpublic void writeThroughCache(Data key, Object value) throws javax.cache.integration.CacheWriterException
javax.cache.integration.CacheWriterExceptionprotected void deleteCacheEntry(Data key)
public void publishCompletedEvent(String cacheName, int completionId, Data dataKey, int orderKey)
ICacheRecordStoreSynchronous Event Listeners require Completion Event to understand all events are executed and it is ready to proceed the method call as this Completion events are always received at the end.
publishCompletedEvent in interface ICacheRecordStorecacheName - cache name.completionId - completion id of the caller method.dataKey - the key.orderKey - order key, all events of a method call will share same order key.public CacheRecord getRecord(Data key)
ICacheRecordStoregetRecord in interface ICacheRecordStorekey - the key to the entry.CacheRecord instance mapped.public void setRecord(Data key, CacheRecord record)
ICacheRecordStoresetRecord in interface ICacheRecordStorekey - the key to the entry.record - the value to be associated with the specified key.public CacheRecord removeRecord(Data key)
ICacheRecordStoreremoveRecord in interface ICacheRecordStorekey - the key to the entry.public Object get(Data key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICacheRecordStorenull if this cache contains no mapping for the key.
 
 If the cache is configured to use read-through, and get would return null
 because the entry is missing from the cache, the Cache's CacheLoader
 is called in an attempt to load the entry.
 
get in interface ICacheRecordStorekey - the key whose associated value is to be returned.expiryPolicy - custom expiry policy or null to use configured default value.protected void onGet(Data key, javax.cache.expiry.ExpiryPolicy expiryPolicy, Object value, R record)
public boolean contains(Data key)
ICacheRecordStoreMore formally, returns true if and only if this store contains a mapping for a key k such that key.equals(k) (There can be at most one such mapping.)
contains in interface ICacheRecordStorekey - key whose presence in this store is to be tested.protected Object getAndPut(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean getValue, boolean disableWriteThrough)
protected Object getAndPut(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean getValue)
protected void onBeforeGetAndPut(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean getValue, boolean disableWriteThrough, R record, Object oldValue, boolean isExpired, boolean willBeNewPut)
protected void onAfterGetAndPut(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean getValue, boolean disableWriteThrough, R record, Object oldValue, boolean isExpired, boolean isNewPut, boolean isSaveSucceed)
protected void onGetAndPutError(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean getValue, boolean disableWriteThrough, R record, Object oldValue, boolean wouldBeNewPut, Throwable error)
public void put(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller)
ICacheRecordStore
 If the cache previously contained a mapping for
 the key, the old value is replaced by the specified value.  (A cache
 c is said to contain a mapping for a key k if and only
 if c.contains(k) would return
 true.)
 
The previous value is returned, or null if there was no value associated with the key previously.
put in interface ICacheRecordStorekey - key with which the specified value is to be associated.value - value to be associated with the specified key.expiryPolicy - custom expiry policy or null to use configured default value.caller - uuid of the calling node or client.public Object getAndPut(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller)
ICacheRecordStore
 If the cache previously contained a mapping for
 the key, the old value is replaced by the specified value.  (A cache
 c is said to contain a mapping for a key k if and only
 if c.contains(k) would return
 true.)
 
The previous value is returned, or null if there was no value associated with the key previously.
getAndPut in interface ICacheRecordStorekey - key with which the specified value is to be associated.value - value to be associated with the specified key.expiryPolicy - custom expiry policy or null to use configured default value.caller - uuid of the calling node or client.protected void onBeforePutIfAbsent(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean disableWriteThrough, R record, boolean isExpired)
protected void onAfterPutIfAbsent(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean disableWriteThrough, R record, boolean isExpired, boolean isSaveSucceed)
protected void onPutIfAbsentError(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean disableWriteThrough, R record, Throwable error)
protected boolean putIfAbsent(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean disableWriteThrough)
public boolean putIfAbsent(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller)
ICacheRecordStore
 More formally, if this cache contains a mapping from key k to
 value v such that
 (key==null ?  k==null : key.equals(k)), that mapping is removed.
 (The cache can contain at most one such mapping.)
 
Returns true if this cache previously associated the key, or false if the cache contained no mapping for the key.
The cache will not contain a mapping for the specified key once the call returns.
putIfAbsent in interface ICacheRecordStorekey - key with which the specified value is to be associated.value - value to be associated with the specified key.expiryPolicy - custom expiry policy or null to use configured default value.caller - uuid of the calling node or client.protected void onBeforeGetAndReplace(Data key, Object oldValue, Object newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean getValue, R record, boolean isExpired)
protected void onAfterGetAndReplace(Data key, Object oldValue, Object newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller, boolean getValue, R record, boolean isExpired, boolean replaced)
public boolean replace(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller)
ICacheRecordStoreThis is equivalent to
 if (cache.containsKey(key)) {
   cache.put(key, value);
   return true;
 } else {
   return false;
 }
 except that the action is performed atomically.replace in interface ICacheRecordStorekey - the key with which the specified value is associated.value - the value to be associated with the specified key.expiryPolicy - custom expiry policy or null to use configured default value.caller - uuid of the calling node or client.public boolean replace(Data key, Object oldValue, Object newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller)
ICacheRecordStoreThis is equivalent to:
 if (cache.containsKey(key) && equals(cache.get(key), oldValue)) {
  cache.put(key, newValue);
 return true;
 } else {
  return false;
 }
 
 except that the action is performed atomically.replace in interface ICacheRecordStorekey - key with which the specified value is associated.oldValue - value expected to be associated with the specified key.newValue - value to be associated with the specified key.expiryPolicy - custom expiry policy or null to use configured default value.caller - uuid of the calling node or client.public Object getAndReplace(Data key, Object value, javax.cache.expiry.ExpiryPolicy expiryPolicy, String caller)
ICacheRecordStoreThis is equivalent to
 if (cache.containsKey(key)) {
   V oldValue = cache.get(key);
   cache.put(key, value);
   return oldValue;
 } else {
   return null;
 }
 
 except that the action is performed atomically.getAndReplace in interface ICacheRecordStorekey - key with which the specified value is associated.value - value to be associated with the specified key.expiryPolicy - custom expiry policy or null to use configured default value.caller - uuid of the calling node or client.protected void onRemove(Data key, Object value, String caller, boolean getValue, R record, boolean removed)
public boolean remove(Data key, String caller)
ICacheRecordStore
 More formally, if this cache contains a mapping from key k to
 value v such that
 (key==null ?  k==null : key.equals(k)), that mapping is removed.
 (The cache can contain at most one such mapping.)
 
Returns true if this cache previously associated the key, or false if the cache contained no mapping for the key.
The cache will not contain a mapping for the specified key once the call returns.
remove in interface ICacheRecordStorekey - key whose mapping is to be removed from the cache.caller - uuid of the calling node or client.public boolean remove(Data key, Object value, String caller)
ICacheRecordStoreThis is equivalent to:
 if (cache.containsKey(key) && equals(cache.get(key), oldValue) {
   cache.remove(key);
   return true;
 } else {
   return false;
 }
 
 except that the action is performed atomically.remove in interface ICacheRecordStorekey - key whose mapping is to be removed from the cache.value - value expected to be associated with the specified key.caller - uuid of the calling node or client.public Object getAndRemove(Data key, String caller)
ICacheRecordStoreThis is equivalent to:
 if (cache.containsKey(key)) {
   V oldValue = cache.get(key);
   cache.remove(key);
   return oldValue;
 } else {
   return null;
 }
 
 except that the action is performed atomically.getAndRemove in interface ICacheRecordStorekey - key with which the specified value is associated.caller - uuid of the calling node or client.public void clear()
ICacheRecordStoreclear in interface ICacheRecordStorepublic MapEntrySet getAll(Set<Data> keySet, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICacheRecordStoreMap of the values associated with the set of keys requested.
 
 If the cache is configured read-through, and a get for a key would
 return null because an entry is missing from the cache, the Cache's
 CacheLoader is called in an attempt to load the entry. If an
 entry cannot be loaded for a given key, the key will not be present in
 the returned Map.
getAll in interface ICacheRecordStorekeySet - keys whose associated values are to be returned.expiryPolicy - custom expiry policy or null to use configured default value.public void removeAll(Set<Data> keys)
ICacheRecordStoreremoveAll in interface ICacheRecordStorekeys - set of keys to be cleaned.public Set<Data> loadAll(Set<Data> keys, boolean replaceExistingValues)
ICacheRecordStoreCacheLoader for the given keys.
 
 If an entry for a key already exists in the cache, a value will be loaded
 if and only if replaceExistingValues is true.  If no loader
 is configured for the cache, no objects will be loaded.
loadAll in interface ICacheRecordStorekeys - the keys to be loaded.replaceExistingValues - when true, existing values in the cache will
                              be replaced by those loaded from a CacheLoader.public CacheKeyIteratorResult iterator(int tableIndex, int size)
ICacheRecordStoresizeiterator in interface ICacheRecordStoretableIndex - initial table index.size - maximum key set size.CacheKeyIteratorResult which wraps keys and last tableIndex.public Object invoke(Data key, javax.cache.processor.EntryProcessor entryProcessor, Object[] arguments)
ICacheRecordStoreEntryProcessor against the Cache.Entry specified by
 the provided key. If an Cache.Entry does not exist for the specified key,
 an attempt is made to load it (if a loader is configured) or a surrogate
 Cache.Entry, consisting of the key with a null value is used instead.
 invoke in interface ICacheRecordStorekey - the key of the entry.entryProcessor - the EntryProcessor to be invoked.arguments - additional arguments to be passed to the
                       EntryProcessor.EntryProcessor implementation.public int size()
ICacheRecordStoresize in interface ICacheRecordStorepublic CacheStatisticsImpl getCacheStats()
ICacheRecordStoreCacheService.getCacheStats in interface ICacheRecordStoreCacheStatisticsImpl cache statistics.public CacheConfig getConfig()
ICacheRecordStoregetConfig in interface ICacheRecordStoreCacheConfigpublic String getName()
ICacheRecordStoregetName in interface ICacheRecordStorepublic Map<Data,CacheRecord> getReadOnlyRecords()
ICacheRecordStoregetReadOnlyRecords in interface ICacheRecordStoreCopyright © 2014 Hazelcast, Inc.. All Rights Reserved.