K - the type of the keyV - the type of the valuepublic interface NearCache<K,V> extends InitializingObject
NearCache is the contract point to store keys and values in underlying
NearCacheRecordStore.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS
Default expiration task delay time as seconds
|
static int |
DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS
Default expiration task initial delay time as seconds
|
static Object |
NULL_OBJECT
NULL Object
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all stored values.
|
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 this
NearCache instance. |
NearCacheStats |
getNearCacheStats()
Get the
NearCacheStats instance to monitor this store. |
NearCachePreloaderConfig |
getPreloaderConfig()
Gets the
NearCachePreloaderConfig of this Near Cache. |
boolean |
isInvalidatedOnChange()
Checks if values are invalidated on changes.
|
boolean |
isPreloadDone()
Checks if the pre-loading of the Near Cache is done.
|
void |
preload(DataStructureAdapter<Data,?> adapter)
Executes the Near Cache pre-loader on the given
DataStructureAdapter. |
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. |
Object |
selectToSave(Object... candidates)
Selects the best candidate object to store from the given
candidates. |
int |
size()
Gets the count of stored records.
|
void |
storeKeys()
Stores the keys of the Near Cache.
|
<T> T |
unwrap(Class<T> clazz)
Used to access non-standard methods of an implementation.
|
initializestatic final int DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS
static final int DEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS
static final Object NULL_OBJECT
String getName()
NearCache instance.NearCache instanceV get(K key)
key.key - the key of the requested valuekeyvoid put(K key, V value)
key.key - the key of the value will be storedvalue - the value will be storedboolean remove(K key)
key.key - the key of the value will be removedboolean isInvalidatedOnChange()
true if values are invalidated on changes, false otherwisevoid clear()
void destroy()
InMemoryFormat getInMemoryFormat()
InMemoryFormat of the storage for internal records.InMemoryFormat of the storage for internal recordsNearCachePreloaderConfig getPreloaderConfig()
NearCachePreloaderConfig of this Near Cache.NearCachePreloaderConfig of this Near CacheNearCacheStats getNearCacheStats()
NearCacheStats instance to monitor this store.NearCacheStats instance to monitor this storeObject selectToSave(Object... candidates)
candidates.candidates - the candidates from which the best candidate object will be selected.candidates.int size()
void preload(DataStructureAdapter<Data,?> adapter)
DataStructureAdapter.void storeKeys()
boolean isPreloadDone()
true if the pre-loading is done, false otherwise.<T> T unwrap(Class<T> clazz)
If this method is called on a wrapper object, result is wrapped object.
T - the type of the class modeled by this Class objectclazz - the type of returning object.IllegalArgumentException - if no implementation found for the supplied clazz type.Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.