public class PassingStorageAdapter extends StorageAdapter
| Modifier and Type | Class and Description |
|---|---|
static class |
PassingStorageAdapter.Tunable |
| Constructor and Description |
|---|
PassingStorageAdapter(BaseCache _cache,
CacheConfig _cacheConfig,
StorageConfiguration _storageConfig) |
| Modifier and Type | Method and Description |
|---|---|
Future<Void> |
cancelTimerJobs()
may be executed more than once
|
boolean |
checkStorageStillDisconnectedForClear()
True means actually no operations started on the storage again, yet
|
Future<Void> |
clearAndReconnect()
Called in a (maybe) separate thread after disconnect.
|
void |
disable(String _logMessage,
Throwable ex) |
void |
disable(Throwable ex) |
void |
disableAndThrow(String _logMessage,
Throwable ex) |
void |
disconnectStorageForClear()
Disconnect storage so cache can wait for all entry operations to finish.
|
void |
evict(Entry e)
If passivation is not enabled, then we need to do nothing here since, the
entry was transferred to the storage on the
StorageAdapter.put(Entry, long)
operation. |
void |
expire(Entry e)
An expired entry was removed from the memory cache and
can also be removed from the storage.
|
void |
flush()
Initiate flush on the storage.
|
StorageEntry |
get(Object k) |
int |
getAlert()
orange alert level if buffer is active, so we get alerted if storage
clear isn't finished.
|
CacheStorage |
getImplementation() |
int |
getTotalEntryCount()
Calculates the cache size, depending on the persistence configuration
|
ClosableIterator<Entry> |
iterateAll() |
protected void |
logLifecycleOperation(String s)
By default log lifecycle operations as info.
|
protected void |
onFlushTimerEvent() |
void |
open() |
void |
purge() |
void |
put(Entry e,
long _nextRefreshTime)
Store entry on cache put.
|
boolean |
remove(Object key) |
Future<Void> |
shutdown() |
String |
toString() |
buildThrowable, rethrowpublic PassingStorageAdapter(BaseCache _cache, CacheConfig _cacheConfig, StorageConfiguration _storageConfig)
protected void logLifecycleOperation(String s)
public void open()
open in class StorageAdapterpublic void put(Entry e, long _nextRefreshTime)
put in class StorageAdapter_nextRefreshTime - value expiry time in millis, 0: expire immediately, Long.MAX_VALUE: no expirypublic StorageEntry get(Object k)
get in class StorageAdapterpublic void evict(Entry e)
StorageAdapter.put(Entry, long)
operation. With passivation enabled, the entries need to be transferred when evicted from
the heap.
The storage operation is done in the calling thread, which should be a client thread.
The cache client will be throttled until the I/O operation is finished. This is what we
want in general. To decouple it, we need to implement async storage I/O support.evict in class StorageAdapterpublic void expire(Entry e)
expire in class StorageAdapterpublic boolean remove(Object key)
remove in class StorageAdapterpublic ClosableIterator<Entry> iterateAll()
iterateAll in class StorageAdapterpublic void purge()
purge in class StorageAdapterprotected void onFlushTimerEvent()
public void flush()
flush in class StorageAdapterpublic Future<Void> cancelTimerJobs()
cancelTimerJobs in class StorageAdapterpublic Future<Void> shutdown()
shutdown in class StorageAdapterpublic boolean checkStorageStillDisconnectedForClear()
checkStorageStillDisconnectedForClear in class StorageAdapterpublic void disconnectStorageForClear()
disconnectStorageForClear in class StorageAdapterpublic Future<Void> clearAndReconnect()
clearAndReconnect in class StorageAdapterpublic void disableAndThrow(String _logMessage, Throwable ex)
public void disable(Throwable ex)
disable in class StorageAdapterpublic int getAlert()
getAlert in class StorageAdapterpublic int getTotalEntryCount()
getTotalEntryCount in class StorageAdapterCache.getTotalEntryCount()public CacheStorage getImplementation()
cache2k API documentation. Copyright © 2000–2015 headissue GmbH, Munich.