public final class StaleReadPreventerNearCacheWrapper extends Object implements NearCache, KeyStateMarker
NearCache
against stale reads by using KeyStateMarker
KeyStateMarker
KeyStateMarker.STATE
DEFAULT_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()
NearCache
this
NearCache
instance.public Object get(Object key)
NearCache
key
.public void put(Object key, Object value)
NearCache
key
.public boolean remove(Object key)
NearCache
key
.public boolean isInvalidateOnChange()
isInvalidateOnChange
in interface NearCache
public void clear()
NearCache
public void destroy()
NearCache
public InMemoryFormat getInMemoryFormat()
NearCache
InMemoryFormat
of the storage for internal records.getInMemoryFormat
in interface NearCache
InMemoryFormat
of the storage for internal recordspublic NearCacheStats getNearCacheStats()
NearCache
NearCacheStats
instance to monitor this store.getNearCacheStats
in interface NearCache
NearCacheStats
instance to monitor this storepublic Object selectToSave(Object... candidates)
NearCache
candidates
.selectToSave
in interface NearCache
candidates
- the candidates from which the best candidate object will be selected.candidates
.public int size()
NearCache
public boolean tryMark(Object key)
tryMark
in interface KeyStateMarker
public boolean tryUnmark(Object key)
tryUnmark
in interface KeyStateMarker
public boolean tryRemove(Object key)
tryRemove
in interface KeyStateMarker
public void forceUnmark(Object key)
forceUnmark
in interface KeyStateMarker
public void init()
init
in interface KeyStateMarker
public KeyStateMarker getKeyStateMarker()
public AtomicIntegerArray getMarks()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.