public class WiredCache<K,V> extends BaseCache<K,V> implements StorageAdapter.Parent, HeapCacheListener<K,V>
HeapCacheListener.NoOperation<K,V>
NO_OPERATION
Constructor and Description |
---|
WiredCache() |
Modifier and Type | Method and Description |
---|---|
void |
cancelTimerJobs()
used from the cache manager for shutdown
|
void |
checkIntegrity()
Cache checks its internal integrity.
|
void |
clear() |
void |
close() |
V |
computeIfAbsent(K key,
Callable<V> callable) |
boolean |
containsAndRemove(K key) |
boolean |
containsKey(K key) |
protected <R> EntryAction<K,V,R> |
createEntryAction(K key,
Entry<K,V> e,
Semantic<K,V,R> op) |
void |
expireAt(K key,
long _millis) |
void |
expireOrScheduleFinalExpireEvent(Entry<K,V> e) |
V |
get(K key) |
Map<K,V> |
getAll(Iterable<? extends K> keys)
We need to deal with possible null values and exceptions.
|
CacheManager |
getCacheManager() |
InternalClock |
getClock()
Time reference for the cache.
|
CommonMetrics |
getCommonMetrics() |
CacheEntry<K,V> |
getEntry(K key) |
String |
getEntryState(K key) |
HeapCache |
getHeapCache()
For testing
|
InternalCacheInfo |
getInfo()
Generate cache statistics.
|
CacheType |
getKeyType() |
InternalCacheInfo |
getLatestInfo()
Generate fresh statistics.
|
Log |
getLog()
used from the cache manager
|
String |
getName() |
StorageAdapter |
getStorage() |
int |
getTotalEntryCount() |
CacheType |
getValueType() |
void |
init() |
<R> R |
invoke(K key,
EntryProcessor<K,V,R> entryProcessor) |
boolean |
isClosed() |
boolean |
isNullValuePermitted() |
Iterator<CacheEntry<K,V>> |
iterator() |
void |
loadAll(Iterable<? extends K> _keys,
CacheOperationCompletionListener l) |
void |
lockAndRunForPurge(K key,
PurgeableStorage.PurgeAction _action)
Insert a cache entry for the given key and run action under the entry
lock.
|
void |
logAndCountInternalException(String s,
Throwable t) |
void |
onEvictionFromHeap(Entry<K,V> e) |
V |
peek(K key) |
Map<K,V> |
peekAll(Iterable<? extends K> keys)
We need to deal with possible null values and exceptions.
|
V |
peekAndPut(K key,
V value) |
V |
peekAndRemove(K key) |
V |
peekAndReplace(K key,
V value) |
CacheEntry<K,V> |
peekEntry(K key) |
void |
prefetch(K key) |
void |
prefetchAll(Iterable<? extends K> _keys,
CacheOperationCompletionListener l) |
void |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
boolean |
putIfAbsent(K key,
V value) |
void |
reloadAll(Iterable<? extends K> _keys,
CacheOperationCompletionListener l) |
void |
remove(K key) |
boolean |
removeIfEquals(K key,
V value) |
boolean |
replace(K key,
V _newValue) |
boolean |
replaceIfEquals(K key,
V _oldValue,
V _newValue) |
CacheEntry<K,V> |
replaceOrGet(K key,
V _oldValue,
V _newValue,
CacheEntry<K,V> _dummyEntry)
Used by JCache impl, since access needs to trigger the TTI maybe use EP instead?
|
void |
resetStorage(StorageAdapter _from,
StorageAdapter to)
Change the storage implementation to another one or null for a disconnect
|
void |
timerEventExpireEntry(Entry<K,V> e) |
void |
timerEventProbationTerminated(Entry<K,V> e) |
void |
timerEventRefresh(Entry<K,V> e) |
String |
toString() |
asMap, clearAndClose, closeCustomization, createCustomization, entries, execute, execute, execute, getSimpleEntry, getStorageMetrics, invokeAll, keys, peekSimpleEntry, removeAll, removeAll, requestInterface
public Log getLog()
InternalCache
getLog
in interface InternalCache<K,V>
public HeapCache getHeapCache()
public InternalClock getClock()
InternalCache
getClock
in interface InternalCache<K,V>
public boolean isNullValuePermitted()
isNullValuePermitted
in interface InternalCache<K,V>
public String getName()
public CacheType getKeyType()
getKeyType
in interface InternalCache<K,V>
public CacheType getValueType()
getValueType
in interface InternalCache<K,V>
public CacheManager getCacheManager()
getCacheManager
in interface Cache<K,V>
public V computeIfAbsent(K key, Callable<V> callable)
computeIfAbsent
in interface Cache<K,V>
public V peekAndReplace(K key, V value)
peekAndReplace
in interface Cache<K,V>
public void prefetch(K key)
public void prefetchAll(Iterable<? extends K> _keys, CacheOperationCompletionListener l)
prefetchAll
in interface AdvancedKeyValueSource<K,V>
prefetchAll
in interface Cache<K,V>
public boolean containsKey(K key)
containsKey
in interface Cache<K,V>
public boolean putIfAbsent(K key, V value)
putIfAbsent
in interface Cache<K,V>
public void remove(K key)
public boolean removeIfEquals(K key, V value)
removeIfEquals
in interface Cache<K,V>
public boolean containsAndRemove(K key)
containsAndRemove
in interface Cache<K,V>
public boolean replaceIfEquals(K key, V _oldValue, V _newValue)
replaceIfEquals
in interface Cache<K,V>
public CacheEntry<K,V> replaceOrGet(K key, V _oldValue, V _newValue, CacheEntry<K,V> _dummyEntry)
InternalCache
replaceOrGet
in interface InternalCache<K,V>
public void loadAll(Iterable<? extends K> _keys, CacheOperationCompletionListener l)
public void reloadAll(Iterable<? extends K> _keys, CacheOperationCompletionListener l)
public Map<K,V> getAll(Iterable<? extends K> keys)
public int getTotalEntryCount()
getTotalEntryCount
in interface InternalCache<K,V>
public <R> R invoke(K key, EntryProcessor<K,V,R> entryProcessor)
public Map<K,V> peekAll(Iterable<? extends K> keys)
public InternalCacheInfo getLatestInfo()
InternalCache
InternalCache.getInfo()
method for requesting information for monitoring.getLatestInfo
in interface InternalCache<K,V>
public InternalCacheInfo getInfo()
InternalCache
getInfo
in interface InternalCache<K,V>
public CommonMetrics getCommonMetrics()
getCommonMetrics
in interface InternalCache<K,V>
public void logAndCountInternalException(String s, Throwable t)
logAndCountInternalException
in interface InternalCache<K,V>
public void checkIntegrity()
CanCheckIntegrity
checkIntegrity
in interface CanCheckIntegrity
public String toString()
public void init()
public void cancelTimerJobs()
InternalCache
cancelTimerJobs
in interface InternalCache<K,V>
public void close()
public void resetStorage(StorageAdapter _from, StorageAdapter to)
StorageAdapter.Parent
resetStorage
in interface StorageAdapter.Parent
public StorageAdapter getStorage()
getStorage
in interface InternalCache<K,V>
getStorage
in class BaseCache<K,V>
public void lockAndRunForPurge(K key, PurgeableStorage.PurgeAction _action)
public void onEvictionFromHeap(Entry<K,V> e)
onEvictionFromHeap
in interface HeapCacheListener<K,V>
protected <R> EntryAction<K,V,R> createEntryAction(K key, Entry<K,V> e, Semantic<K,V,R> op)
createEntryAction
in class BaseCache<K,V>
public String getEntryState(K key)
getEntryState
in interface InternalCache<K,V>
public void timerEventExpireEntry(Entry<K,V> e)
timerEventExpireEntry
in interface InternalCache<K,V>
public void expireOrScheduleFinalExpireEvent(Entry<K,V> e)
expireOrScheduleFinalExpireEvent
in interface InternalCache<K,V>
HeapCache.expireOrScheduleFinalExpireEvent(Entry)
public void timerEventRefresh(Entry<K,V> e)
timerEventRefresh
in interface InternalCache<K,V>
public void timerEventProbationTerminated(Entry<K,V> e)
timerEventProbationTerminated
in interface InternalCache<K,V>
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.