Class BitsetFilterCache
java.lang.Object
org.elasticsearch.index.AbstractIndexComponent
org.elasticsearch.index.cache.bitset.BitsetFilterCache
- All Implemented Interfaces:
Closeable
,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>>, 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
Modifier and TypeClassDescriptionstatic interface
A listener interface that is executed for each onCache / onRemoval eventstatic class
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class org.elasticsearch.index.AbstractIndexComponent
deprecationLogger, indexSettings, logger
-
Constructor Summary
ConstructorDescriptionBitsetFilterCache(IndexSettings indexSettings, BitsetFilterCache.Listener listener)
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.lucene.util.BitSet
bitsetFromQuery(org.apache.lucene.search.Query query, org.apache.lucene.index.LeafReaderContext context)
void
void
close()
createListener(ThreadPool threadPool)
org.apache.lucene.search.join.BitSetProducer
getBitSetProducer(org.apache.lucene.search.Query query)
void
onClose(org.apache.lucene.index.IndexReader.CacheKey ownerCoreCacheKey)
void
onRemoval(RemovalNotification<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>> notification)
Methods inherited from class org.elasticsearch.index.AbstractIndexComponent
getIndexSettings, index
-
Field Details
-
INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING
-
-
Constructor Details
-
BitsetFilterCache
-
-
Method Details
-
bitsetFromQuery
public static org.apache.lucene.util.BitSet bitsetFromQuery(org.apache.lucene.search.Query query, org.apache.lucene.index.LeafReaderContext context) throws IOException- Throws:
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:
onClose
in interfaceorg.apache.lucene.index.IndexReader.ClosedListener
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
clear
-
onRemoval
public void onRemoval(RemovalNotification<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>> notification)- Specified by:
onRemoval
in interfaceRemovalListener<org.apache.lucene.index.IndexReader.CacheKey,Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>>
-