Class BitsetFilterCache
- java.lang.Object
-
- org.elasticsearch.index.AbstractIndexComponent
-
- org.elasticsearch.index.cache.bitset.BitsetFilterCache
-
- All Implemented Interfaces:
Closeable,AutoCloseable,IndexReader.ClosedListener,RemovalListener<IndexReader.CacheKey,Cache<Query,BitsetFilterCache.Value>>,IndexComponent
public final class BitsetFilterCache extends AbstractIndexComponent implements IndexReader.ClosedListener, RemovalListener<IndexReader.CacheKey,Cache<Query,BitsetFilterCache.Value>>, Closeable
This is a cache forBitDocIdSetbased 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
BitDocIdSetand require that it should always be around should use this cache, otherwise theQueryCacheshould 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<Boolean>INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING-
Fields inherited from class org.elasticsearch.index.AbstractIndexComponent
deprecationLogger, indexSettings, logger
-
-
Constructor Summary
Constructors Constructor Description BitsetFilterCache(IndexSettings indexSettings, BitsetFilterCache.Listener listener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BitSetbitsetFromQuery(Query query, LeafReaderContext context)voidclear(String reason)voidclose()IndexWarmer.ListenercreateListener(ThreadPool threadPool)BitSetProducergetBitSetProducer(Query query)voidonClose(IndexReader.CacheKey ownerCoreCacheKey)Invoked when the resource (segment core, or index reader) that is being cached on is closed.voidonRemoval(RemovalNotification<IndexReader.CacheKey,Cache<Query,BitsetFilterCache.Value>> notification)-
Methods inherited from class org.elasticsearch.index.AbstractIndexComponent
getIndexSettings, index
-
-
-
-
Constructor Detail
-
BitsetFilterCache
public BitsetFilterCache(IndexSettings indexSettings, BitsetFilterCache.Listener listener)
-
-
Method Detail
-
bitsetFromQuery
public static BitSet bitsetFromQuery(Query query, LeafReaderContext context) throws IOException
- Throws:
IOException
-
createListener
public IndexWarmer.Listener createListener(ThreadPool threadPool)
-
getBitSetProducer
public BitSetProducer getBitSetProducer(Query query)
-
onClose
public void onClose(IndexReader.CacheKey ownerCoreCacheKey)
Description copied from interface:IndexReader.ClosedListenerInvoked when the resource (segment core, or index reader) that is being cached on is closed.- Specified by:
onClosein interfaceIndexReader.ClosedListener
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
clear
public void clear(String reason)
-
onRemoval
public void onRemoval(RemovalNotification<IndexReader.CacheKey,Cache<Query,BitsetFilterCache.Value>> notification)
- Specified by:
onRemovalin interfaceRemovalListener<IndexReader.CacheKey,Cache<Query,BitsetFilterCache.Value>>
-
-