Class BitsetFilterCache
java.lang.Object
org.elasticsearch.index.AbstractIndexComponent
org.elasticsearch.index.cache.bitset.BitsetFilterCache
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.lucene.index.IndexReader.ClosedListener,RemovalListener<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>>,IndexComponent
public final class BitsetFilterCache extends AbstractIndexComponent implements org.apache.lucene.index.IndexReader.ClosedListener, RemovalListener<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>>, java.io.Closeable
This is a cache for
BitDocIdSet based filters and is unbounded by size or time.
Use this cache with care, only components that require that a filter is to be materialized as a BitDocIdSet
and require that it should always be around should use this cache, otherwise the
QueryCache should be used instead.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBitsetFilterCache.ListenerA listener interface that is executed for each onCache / onRemoval eventstatic classBitsetFilterCache.Value -
Field Summary
Fields Modifier and Type Field Description static Setting<java.lang.Boolean>INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTINGFields inherited from class org.elasticsearch.index.AbstractIndexComponent
deprecationLogger, indexSettings, logger -
Constructor Summary
Constructors Constructor Description BitsetFilterCache(IndexSettings indexSettings, BitsetFilterCache.Listener listener) -
Method Summary
Modifier and Type Method Description static org.apache.lucene.util.BitSetbitsetFromQuery(org.apache.lucene.search.Query query, org.apache.lucene.index.LeafReaderContext context)voidclear(java.lang.String reason)voidclose()IndexWarmer.ListenercreateListener(ThreadPool threadPool)org.apache.lucene.search.join.BitSetProducergetBitSetProducer(org.apache.lucene.search.Query query)voidonClose(org.apache.lucene.index.IndexReader.CacheKey ownerCoreCacheKey)voidonRemoval(RemovalNotification<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>> notification)
-
Field Details
-
Constructor Details
-
Method Details
-
bitsetFromQuery
public static org.apache.lucene.util.BitSet bitsetFromQuery(org.apache.lucene.search.Query query, org.apache.lucene.index.LeafReaderContext context) throws java.io.IOException- Throws:
java.io.IOException
-
createListener
-
getBitSetProducer
public org.apache.lucene.search.join.BitSetProducer getBitSetProducer(org.apache.lucene.search.Query query) -
onClose
public void onClose(org.apache.lucene.index.IndexReader.CacheKey ownerCoreCacheKey)- Specified by:
onClosein interfaceorg.apache.lucene.index.IndexReader.ClosedListener
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
clear
public void clear(java.lang.String reason) -
onRemoval
public void onRemoval(RemovalNotification<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>> notification)- Specified by:
onRemovalin interfaceRemovalListener<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>>
-