public final class StaleReadPreventerNearCacheWrapper extends Object implements NearCache, KeyStateMarker
NearCache against stale reads by using KeyStateMarkerKeyStateMarkerKeyStateMarker.STATEDEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS, DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS, NULL_OBJECT| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all stored values.
|
void |
destroy()
Clears the record store and destroys it.
|
void |
forceUnmark(Object key) |
Object |
get(Object key)
Gets the value associated with the given
key. |
InMemoryFormat |
getInMemoryFormat()
Gets the
InMemoryFormat of the storage for internal records. |
KeyStateMarker |
getKeyStateMarker() |
AtomicIntegerArray |
getMarks() |
String |
getName()
Gets the name of the
this NearCache instance. |
NearCacheStats |
getNearCacheStats()
Get the
NearCacheStats instance to monitor this store. |
void |
init() |
boolean |
isInvalidateOnChange() |
void |
put(Object key,
Object value)
Puts (associates) a value with the given
key. |
boolean |
remove(Object key)
Removes the value associated with the given
key. |
Object |
selectToSave(Object... candidates)
Selects the best candidate object to store from the given
candidates. |
int |
size()
Gets the count of stored records.
|
String |
toString() |
boolean |
tryMark(Object key) |
boolean |
tryRemove(Object key) |
boolean |
tryUnmark(Object key) |
static NearCache |
wrapAsStaleReadPreventerNearCache(NearCache nearCache,
int markerCount) |
public static NearCache wrapAsStaleReadPreventerNearCache(NearCache nearCache, int markerCount)
public String getName()
NearCachethis NearCache instance.public Object get(Object key)
NearCachekey.public void put(Object key, Object value)
NearCachekey.public boolean remove(Object key)
NearCachekey.public boolean isInvalidateOnChange()
isInvalidateOnChange in interface NearCachepublic void clear()
NearCachepublic void destroy()
NearCachepublic InMemoryFormat getInMemoryFormat()
NearCacheInMemoryFormat of the storage for internal records.getInMemoryFormat in interface NearCacheInMemoryFormat of the storage for internal recordspublic NearCacheStats getNearCacheStats()
NearCacheNearCacheStats instance to monitor this store.getNearCacheStats in interface NearCacheNearCacheStats instance to monitor this storepublic Object selectToSave(Object... candidates)
NearCachecandidates.selectToSave in interface NearCachecandidates - the candidates from which the best candidate object will be selected.candidates.public int size()
NearCachepublic boolean tryMark(Object key)
tryMark in interface KeyStateMarkerpublic boolean tryUnmark(Object key)
tryUnmark in interface KeyStateMarkerpublic boolean tryRemove(Object key)
tryRemove in interface KeyStateMarkerpublic void forceUnmark(Object key)
forceUnmark in interface KeyStateMarkerpublic void init()
init in interface KeyStateMarkerpublic KeyStateMarker getKeyStateMarker()
public AtomicIntegerArray getMarks()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.