class QueryIndex
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
QueryIndex.CachePopulator |
(package private) static class |
QueryIndex.DataValues |
(package private) static class |
QueryIndex.FIELDS |
private static class |
QueryIndex.Indexable |
(package private) static class |
QueryIndex.MonitorQueryCollector
A Collector that decodes the stored query for each document hit.
|
(package private) static interface |
QueryIndex.QueryBuilder |
(package private) static interface |
QueryIndex.QueryCollector |
(package private) static class |
QueryIndex.QueryTermFilter |
private class |
QueryIndex.TermsHashBuilder |
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
commitLock |
private QueryDecomposer |
decomposer |
private static BytesRef |
EMPTY |
private SearcherManager |
manager |
private Presearcher |
presearcher |
private java.util.Map<java.lang.String,QueryCacheEntry> |
purgeCache |
private java.util.concurrent.locks.ReadWriteLock |
purgeLock |
private java.util.concurrent.ConcurrentMap<java.lang.String,QueryCacheEntry> |
queries |
private MonitorQuerySerializer |
serializer |
(package private) java.util.Map<IndexReader.CacheKey,QueryIndex.QueryTermFilter> |
termFilters |
private IndexWriter |
writer |
Constructor and Description |
---|
QueryIndex(MonitorConfiguration config,
Presearcher presearcher) |
Modifier and Type | Method and Description |
---|---|
private java.util.List<QueryIndex.Indexable> |
buildIndexables(java.util.List<MonitorQuery> updates) |
(package private) int |
cacheSize() |
(package private) void |
clear() |
void |
close() |
(package private) void |
commit(java.util.List<MonitorQuery> updates) |
(package private) void |
deleteQueries(java.lang.Iterable<java.lang.String> ids) |
(package private) MonitorQuery |
getQuery(java.lang.String queryId) |
(package private) int |
numDocs() |
private void |
populateQueryCache(MonitorQuerySerializer serializer,
QueryDecomposer decomposer) |
(package private) void |
purgeCache() |
private void |
purgeCache(QueryIndex.CachePopulator populator)
Remove unused queries from the query cache.
|
(package private) void |
scan(QueryIndex.QueryCollector matcher) |
(package private) long |
search(QueryIndex.QueryBuilder queryBuilder,
QueryIndex.QueryCollector matcher) |
(package private) long |
search(Query query,
QueryIndex.QueryCollector matcher) |
private final IndexWriter writer
private final SearcherManager manager
private final QueryDecomposer decomposer
private final MonitorQuerySerializer serializer
private final Presearcher presearcher
private volatile java.util.Map<java.lang.String,QueryCacheEntry> purgeCache
private final java.util.concurrent.locks.ReadWriteLock purgeLock
private final java.lang.Object commitLock
private volatile java.util.concurrent.ConcurrentMap<java.lang.String,QueryCacheEntry> queries
final java.util.Map<IndexReader.CacheKey,QueryIndex.QueryTermFilter> termFilters
private static final BytesRef EMPTY
QueryIndex(MonitorConfiguration config, Presearcher presearcher) throws java.io.IOException
java.io.IOException
private void populateQueryCache(MonitorQuerySerializer serializer, QueryDecomposer decomposer) throws java.io.IOException
java.io.IOException
void commit(java.util.List<MonitorQuery> updates) throws java.io.IOException
java.io.IOException
private java.util.List<QueryIndex.Indexable> buildIndexables(java.util.List<MonitorQuery> updates)
MonitorQuery getQuery(java.lang.String queryId) throws java.io.IOException
java.io.IOException
void scan(QueryIndex.QueryCollector matcher) throws java.io.IOException
java.io.IOException
long search(Query query, QueryIndex.QueryCollector matcher) throws java.io.IOException
java.io.IOException
long search(QueryIndex.QueryBuilder queryBuilder, QueryIndex.QueryCollector matcher) throws java.io.IOException
java.io.IOException
void purgeCache() throws java.io.IOException
java.io.IOException
private void purgeCache(QueryIndex.CachePopulator populator) throws java.io.IOException
This is normally called from a background thread at a rate set by configurePurgeFrequency().
java.io.IOException
- on IO errorspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
int numDocs()
int cacheSize()
void deleteQueries(java.lang.Iterable<java.lang.String> ids) throws java.io.IOException
java.io.IOException
void clear() throws java.io.IOException
java.io.IOException