public class ClearStorageBuffer extends Object implements CacheStorage, FlushableStorage, PurgeableStorage
TODO-C: Multi threaded storage playback
FlushableStorage.FlushContextCacheStorage.EntryFilter, CacheStorage.EntryVisitor, CacheStorage.MultiThreadedContext, CacheStorage.VisitContextPurgeableStorage.PurgeAction, PurgeableStorage.PurgeContext, PurgeableStorage.PurgeResult| Constructor and Description |
|---|
ClearStorageBuffer() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all entries from the cache and free resources.
|
void |
close()
Free all resources and stop operations immediately.
|
boolean |
contains(Object key)
Returns true if there is a mapping for the key.
|
void |
disableOnFailure(Throwable t) |
void |
flush(FlushableStorage.FlushContext ctx,
long now)
Stall this thread until the op is executed.
|
StorageEntry |
get(Object key)
Retrieve the entry from the storage.
|
int |
getEntryCount() |
boolean |
isTransferringToStorage() |
PurgeableStorage.PurgeResult |
purge(PurgeableStorage.PurgeContext ctx,
long _valueExpiryTime,
long _entryExpiryTime)
Does nothing.
|
void |
put(StorageEntry e)
Stores the entry in the storage.
|
boolean |
remove(Object key) |
void |
startTransfer() |
void |
transfer() |
void |
visit(CacheStorage.VisitContext ctx,
CacheStorage.EntryFilter f,
CacheStorage.EntryVisitor v)
Iterate over all stored entries and call the entry visitor.
|
public ClearStorageBuffer()
public void flush(FlushableStorage.FlushContext ctx, long now) throws Exception
flush in interface FlushableStorageExceptionpublic PurgeableStorage.PurgeResult purge(PurgeableStorage.PurgeContext ctx, long _valueExpiryTime, long _entryExpiryTime)
purge in interface PurgeableStoragectx - Provides a multi-threaded context. Thread resources for purge
operations may be more limited or may have lower priority._valueExpiryTime - request to remove entries with lower value of
StorageEntry.getValueExpiryTime()_entryExpiryTime - request to remove entries with with lower value of
StorageEntry.getEntryExpiryTime()public void close() throws Exception
CacheStorageclose in interface CacheStorageExceptionpublic void clear() throws Exception
CacheStorageclear in interface CacheStorageExceptionpublic void put(StorageEntry e) throws Exception
CacheStorageput in interface CacheStorageIOException - may be thrown if hope is lostExceptionpublic StorageEntry get(Object key) throws Exception
CacheStorageDepending on the cache configuration, an exception on get is not severe. The cache will try other sources or return null.
get in interface CacheStorageExceptionpublic boolean remove(Object key) throws Exception
remove in interface CacheStorageExceptionpublic boolean contains(Object key) throws Exception
CacheStorageAn exception on contains is not severe. The cache will try other sources or return null.
contains in interface CacheStorageExceptionpublic void visit(CacheStorage.VisitContext ctx, CacheStorage.EntryFilter f, CacheStorage.EntryVisitor v) throws Exception
CacheStoragePurgeableStorage is not
implemented, returning expired entries is a must, to support the generic purge
algorithm.
If the ExecutorService is used, the method may return immediately without
the waiting for all threads to finish. This is done by the caller, when needed.visit in interface CacheStorageExceptionpublic int getEntryCount()
getEntryCount in interface CacheStoragepublic void startTransfer()
public boolean isTransferringToStorage()
public void disableOnFailure(Throwable t)
cache2k API documentation. Copyright © 2000–2015 headissue GmbH, Munich.