Modifier and Type | Class and Description |
---|---|
protected class |
DefaultNearCache.ExpirationTask |
Modifier and Type | Field and Description |
---|---|
protected ScheduledFuture |
expirationTaskFuture |
protected String |
name |
protected NearCacheConfig |
nearCacheConfig |
protected NearCacheContext |
nearCacheContext |
protected NearCacheRecordStore<K,V> |
nearCacheRecordStore |
protected SerializationService |
serializationService |
DEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS, DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS, NULL_OBJECT
Constructor and Description |
---|
DefaultNearCache(String name,
NearCacheConfig nearCacheConfig,
NearCacheContext nearCacheContext) |
DefaultNearCache(String name,
NearCacheConfig nearCacheConfig,
NearCacheContext nearCacheContext,
NearCacheRecordStore<K,V> nearCacheRecordStore) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all stored values.
|
protected DefaultNearCache.ExpirationTask |
createExpirationTask() |
protected NearCacheRecordStore<K,V> |
createNearCacheRecordStore(NearCacheConfig nearCacheConfig,
NearCacheContext nearCacheContext) |
void |
destroy()
Clears the record store and destroys it.
|
V |
get(K key)
Gets the value associated with the given
key . |
InMemoryFormat |
getInMemoryFormat()
Gets the
InMemoryFormat of the storage for internal records. |
String |
getName()
Gets the name of the
this NearCache instance. |
NearCacheStats |
getNearCacheStats()
Get the
NearCacheStats instance to monitor this store. |
protected void |
init() |
protected boolean |
isExpirationAvailable() |
boolean |
isInvalidateOnChange() |
void |
put(K key,
V value)
Puts (associates) a value with the given
key . |
boolean |
remove(K key)
Removes the value associated with the given
key . |
protected ScheduledFuture |
scheduleExpirationTask(NearCacheExecutor nearCacheExecutor,
DefaultNearCache.ExpirationTask expirationTask) |
Object |
selectToSave(Object... candidates)
Selects the best candidate object to store from the given
candidates . |
int |
size()
Gets the count of stored records.
|
protected void |
startExpirationTask() |
protected final String name
protected final NearCacheConfig nearCacheConfig
protected final NearCacheContext nearCacheContext
protected final SerializationService serializationService
protected NearCacheRecordStore<K,V> nearCacheRecordStore
protected ScheduledFuture expirationTaskFuture
public DefaultNearCache(String name, NearCacheConfig nearCacheConfig, NearCacheContext nearCacheContext)
public DefaultNearCache(String name, NearCacheConfig nearCacheConfig, NearCacheContext nearCacheContext, NearCacheRecordStore<K,V> nearCacheRecordStore)
protected void init()
protected void startExpirationTask()
protected boolean isExpirationAvailable()
protected DefaultNearCache.ExpirationTask createExpirationTask()
protected ScheduledFuture scheduleExpirationTask(NearCacheExecutor nearCacheExecutor, DefaultNearCache.ExpirationTask expirationTask)
protected NearCacheRecordStore<K,V> createNearCacheRecordStore(NearCacheConfig nearCacheConfig, NearCacheContext nearCacheContext)
public String getName()
NearCache
this
NearCache
instance.public V get(K key)
NearCache
key
.public void put(K key, V value)
NearCache
key
.public boolean remove(K key)
NearCache
key
.public boolean isInvalidateOnChange()
isInvalidateOnChange
in interface NearCache<K,V>
public void clear()
NearCache
public void destroy()
NearCache
public InMemoryFormat getInMemoryFormat()
NearCache
InMemoryFormat
of the storage for internal records.getInMemoryFormat
in interface NearCache<K,V>
InMemoryFormat
of the storage for internal recordspublic NearCacheStats getNearCacheStats()
NearCache
NearCacheStats
instance to monitor this store.getNearCacheStats
in interface NearCache<K,V>
NearCacheStats
instance to monitor this storepublic Object selectToSave(Object... candidates)
NearCache
candidates
.selectToSave
in interface NearCache<K,V>
candidates
- the candidates from which the best candidate object will be selected.candidates
.Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.