public class BitsetFilterCache extends AbstractIndexComponent implements org.apache.lucene.index.LeafReader.CoreClosedListener, com.google.common.cache.RemovalListener<Object,com.google.common.cache.Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>>, Closeable
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.
Modifier and Type | Class and Description |
---|---|
static interface |
BitsetFilterCache.Listener
A listener interface that is executed for each onCache / onRemoval event
|
static class |
BitsetFilterCache.Value |
Modifier and Type | Field and Description |
---|---|
static String |
LOAD_RANDOM_ACCESS_FILTERS_EAGERLY |
deprecationLogger, index, indexSettings, logger
Constructor and Description |
---|
BitsetFilterCache(Index index,
IndexSettingsService indexSettingsService) |
Modifier and Type | Method and Description |
---|---|
void |
clear(String reason) |
void |
close() |
org.apache.lucene.search.join.BitSetProducer |
getBitSetProducer(org.apache.lucene.search.Query query) |
void |
onClose(Object ownerCoreCacheKey) |
void |
onRemoval(com.google.common.cache.RemovalNotification<Object,com.google.common.cache.Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>> notification) |
void |
setIndicesWarmer(IndicesWarmer indicesWarmer) |
void |
setListener(BitsetFilterCache.Listener listener)
Sets a listener that is invoked for all subsequent cache and removal events.
|
index, indexSettings
public static final String LOAD_RANDOM_ACCESS_FILTERS_EAGERLY
@Inject public BitsetFilterCache(Index index, IndexSettingsService indexSettingsService)
@Inject(optional=true) public void setIndicesWarmer(IndicesWarmer indicesWarmer)
public void setListener(BitsetFilterCache.Listener listener)
IllegalStateException
- if the listener is set more than oncepublic org.apache.lucene.search.join.BitSetProducer getBitSetProducer(org.apache.lucene.search.Query query)
public void onClose(Object ownerCoreCacheKey)
onClose
in interface org.apache.lucene.index.LeafReader.CoreClosedListener
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void clear(String reason)
public void onRemoval(com.google.common.cache.RemovalNotification<Object,com.google.common.cache.Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>> notification)
onRemoval
in interface com.google.common.cache.RemovalListener<Object,com.google.common.cache.Cache<org.apache.lucene.search.Query,BitsetFilterCache.Value>>
Copyright © 2009–2016. All rights reserved.