public class SoftIndexFileStore extends Object implements AdvancedLoadWriteStore
AdvancedCacheLoader.CacheLoaderTask<K,V>, AdvancedCacheLoader.TaskContextAdvancedCacheWriter.PurgeListener<K>| Constructor and Description |
|---|
SoftIndexFileStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all the data from the storage.
|
boolean |
contains(Object key)
Returns true if the storage contains an entry associated with the given key.
|
String |
debugInfo(Object key)
This method should be called by reflection to get more info about the missing/invalid key (from test tools)
|
boolean |
delete(Object key) |
void |
init(InitializationContext ctx)
Used to initialize a cache loader.
|
boolean |
isAvailable() |
protected boolean |
isIndexLoaded() |
protected boolean |
isSeqIdOld(long seqId,
Object key,
byte[] serializedKey) |
MarshalledEntry |
load(Object key)
Fetches an entry from the storage.
|
org.reactivestreams.Publisher<MarshalledEntry> |
publishEntries(Predicate filter,
boolean fetchValue,
boolean fetchMetadata)
Publishes all entries from this store.
|
org.reactivestreams.Publisher |
publishKeys(Predicate filter)
Publishes all the keys from this store.
|
void |
purge(Executor threadPool,
AdvancedCacheWriter.PurgeListener listener)
Using the thread in the pool, removed all the expired data from the persistence storage.
|
int |
size()
Returns the number of elements in the store.
|
void |
start()
Invoked on component start
|
protected void |
startIndex() |
void |
stop()
Invoked on component stop
|
void |
write(MarshalledEntry entry)
Persists the entry to the storage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessdeleteBatch, writeBatchpublic void init(InitializationContext ctx)
CacheLoaderPersistenceManager
when setting up cache loaders.init in interface CacheLoaderinit in interface CacheWriterpublic void start()
Lifecycleprotected boolean isSeqIdOld(long seqId,
Object key,
byte[] serializedKey)
throws IOException
IOExceptionprotected void startIndex()
protected boolean isIndexLoaded()
public void stop()
Lifecyclepublic boolean isAvailable()
isAvailable in interface CacheLoaderisAvailable in interface CacheWriterisAvailable in interface ExternalStorepublic void clear()
throws PersistenceException
AdvancedCacheWriterclear in interface AdvancedCacheWriterPersistenceException - in case of an error, e.g. communicating with the external storagepublic int size()
AdvancedCacheLoadersize in interface AdvancedCacheLoaderpublic void purge(Executor threadPool, AdvancedCacheWriter.PurgeListener listener)
AdvancedCacheWriterWhen this method returns all entries will be purged and no tasks will be running due to this loader in the provided executor. If however an exception is thrown there could be tasks still pending or running in the executor.
purge in interface AdvancedCacheWriterpublic void write(MarshalledEntry entry)
CacheWriterwrite in interface CacheWriterMarshalledEntrypublic boolean delete(Object key)
delete in interface CacheWriterpublic boolean contains(Object key)
CacheLoadercontains in interface CacheLoaderpublic MarshalledEntry load(Object key)
CacheLoaderMarshalledEntry needs to be created here, InitializationContext.getMarshalledEntryFactory() and InitializationContext.getByteBufferFactory() should be used.load in interface CacheLoaderpublic String debugInfo(Object key)
key - public org.reactivestreams.Publisher publishKeys(Predicate filter)
AdvancedCacheLoaderSubscribers as desired. Keys are not retrieved until a given Subscriber requests
them from the Subscription.
Stores will return only non expired keys
publishKeys in interface AdvancedCacheLoaderfilter - a filterpublic org.reactivestreams.Publisher<MarshalledEntry> publishEntries(Predicate filter, boolean fetchValue, boolean fetchMetadata)
AdvancedCacheLoaderSubscribers as desired. Entries are not retrieved until a given Subscriber requests
them from the Subscription.
If fetchMetadata is true this store must guarantee to not return any expired entries.
publishEntries in interface AdvancedCacheLoaderCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.