Class 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
    • Constructor Detail

      • LuceneCacheLoader

        public LuceneCacheLoader()
    • Method Detail

      • contains

        public boolean contains​(Object key)
        Description copied from interface: CacheLoader
        Returns true if the storage contains an entry associated with the given key.
        Specified by:
        contains in interface CacheLoader<K,​V>
      • publishEntries

        public org.reactivestreams.Publisher<MarshalledEntry<K,​V>> publishEntries​(Predicate<? super K> filter,
                                                                                        boolean fetchValue,
                                                                                        boolean fetchMetadata)
        Description copied from interface: AdvancedCacheLoader
        Publishes all entries from this store. The given publisher can be used by as many Subscribers 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.

        Specified by:
        publishEntries in interface AdvancedCacheLoader<K,​V>
        Parameters:
        filter - a filter - null is treated as allowing all entries
        fetchValue - 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 well
        fetchMetadata - 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
      • start

        public void start()
        Description copied from interface: Lifecycle
        Invoked on component start
        Specified by:
        start in interface Lifecycle
      • stop

        public void stop()
        Description copied from interface: Lifecycle
        Invoked on component stop
        Specified by:
        stop in interface Lifecycle