Module org.elasticsearch.server
Package org.elasticsearch.indices
Class IndicesQueryCache.OptionalCachingWeight
java.lang.Object
org.apache.lucene.search.Weight
org.apache.lucene.search.FilterWeight
org.elasticsearch.indices.IndicesQueryCache.OptionalCachingWeight
- All Implemented Interfaces:
org.apache.lucene.search.SegmentCacheable
- Enclosing class:
IndicesQueryCache
public abstract static class IndicesQueryCache.OptionalCachingWeight
extends org.apache.lucene.search.FilterWeight
A
Weight that controls whether cache population should proceed for a given leaf.
This is useful when multiple threads query different ranges of the same segment concurrently;
ideally only one thread populates the cache while others fall back to uncached iteration
or wait for caching to complete and then use the cached result.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.Weight
org.apache.lucene.search.Weight.DefaultBulkScorer, org.apache.lucene.search.Weight.DefaultScorerSupplier -
Field Summary
Fields inherited from class org.apache.lucene.search.FilterWeight
inFields inherited from class org.apache.lucene.search.Weight
parentQuery -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOptionalCachingWeight(org.apache.lucene.search.Weight weight) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ReleasablestartCaching(org.apache.lucene.index.LeafReaderContext leaf) Attempts to claim the right to populate the cache for the given leaf.Methods inherited from class org.apache.lucene.search.FilterWeight
count, explain, isCacheable, matches, scorerSupplierMethods inherited from class org.apache.lucene.search.Weight
bulkScorer, getQuery, scorer
-
Constructor Details
-
OptionalCachingWeight
protected OptionalCachingWeight(org.apache.lucene.search.Weight weight)
-
-
Method Details
-
startCaching
Attempts to claim the right to populate the cache for the given leaf. Returns aReleasablethat must be closed once caching is complete, ornullif another thread is already caching this segment.
-