Class LuceneCacheLoader<K,V>
- java.lang.Object
-
- org.infinispan.lucene.cacheloader.LuceneCacheLoader<K,V>
-
- All Implemented Interfaces:
Lifecycle,AdvancedCacheLoader<K,V>,CacheLoader<K,V>
public class LuceneCacheLoader<K,V> extends Object implements AdvancedCacheLoader<K,V>
A CacheLoader meant to load Lucene index(es) from filesystem based Lucene index(es). This is exclusively suitable for keys being used by the Directory, any other key will be ignored. The InfinispanDirectory requires indexes to be named; this CacheLoader needs to be configured with the path of the root directory containing the indexes, and expects index names to match directory names under this common root path.- Since:
- 5.2
- Author:
- Sanne Grinovero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.spi.AdvancedCacheLoader
AdvancedCacheLoader.CacheLoaderTask<K,V>, AdvancedCacheLoader.TaskContext
-
-
Constructor Summary
Constructors Constructor Description LuceneCacheLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Object key)Returns true if the storage contains an entry associated with the given key.voidinit(InitializationContext ctx)Used to initialize a cache loader.MarshalledEntryload(Object key)Fetches an entry from the storage.org.reactivestreams.Publisher<MarshalledEntry<K,V>>publishEntries(Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata)Publishes all entries from this store.intsize()Returns the number of elements in the store.voidstart()Invoked on component startvoidstop()Invoked on component stop-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.persistence.spi.AdvancedCacheLoader
process, publishKeys
-
Methods inherited from interface org.infinispan.persistence.spi.CacheLoader
isAvailable
-
-
-
-
Method Detail
-
init
public void init(InitializationContext ctx)
Description copied from interface:CacheLoaderUsed to initialize a cache loader. Typically invoked by thePersistenceManagerwhen setting up cache loaders.- Specified by:
initin interfaceCacheLoader<K,V>
-
load
public MarshalledEntry load(Object key)
Description copied from interface:CacheLoaderFetches an entry from the storage. If aMarshalledEntryneeds to be created here,InitializationContext.getMarshalledEntryFactory()andInitializationContext.getByteBufferFactory()should be used.- Specified by:
loadin interfaceCacheLoader<K,V>- Returns:
- the entry, or null if the entry does not exist
-
contains
public boolean contains(Object key)
Description copied from interface:CacheLoaderReturns true if the storage contains an entry associated with the given key.- Specified by:
containsin interfaceCacheLoader<K,V>
-
publishEntries
public org.reactivestreams.Publisher<MarshalledEntry<K,V>> publishEntries(Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata)
Description copied from interface:AdvancedCacheLoaderPublishes all entries from this store. The given publisher can be used by as manySubscribers as desired. Entries are not retrieved until a given Subscriber requests them from theSubscription.If fetchMetadata is true this store must guarantee to not return any expired entries.
- Specified by:
publishEntriesin interfaceAdvancedCacheLoader<K,V>- Parameters:
filter- a filter - null is treated as allowing all entriesfetchValue- whether or not to fetch the value from the persistent store. E.g. if the iteration is intended only over the key set, no point fetching the values from the persistent store as wellfetchMetadata- whether or not to fetch the metadata from the persistent store. E.g. if the iteration is intended only ove the key set, then no point fetching the metadata from the persistent store as well- Returns:
- a publisher that will provide the entries from the store
-
size
public int size()
Description copied from interface:AdvancedCacheLoaderReturns the number of elements in the store.- Specified by:
sizein interfaceAdvancedCacheLoader<K,V>
-
start
public void start()
Description copied from interface:LifecycleInvoked on component start
-
-