public static class QueryCachingPolicy.CacheOnLargeSegments extends Object implements QueryCachingPolicy
|Modifier and Type||Field and Description|
|Constructor and Description|
|Modifier and Type||Method and Description|
Callback that is called every time that a cached filter is used.
Whether the given
public static final QueryCachingPolicy.CacheOnLargeSegments DEFAULT
QueryCachingPolicy.CacheOnLargeSegmentsinstance that only caches on segments that account for more than 3% of the total index size. This should guarantee that all segments from the upper
tierwill be cached while ensuring that at most 33 segments can make it to the cache (given that some implementations such as
LRUQueryCacheperform better when the number of cached segments is low).
public CacheOnLargeSegments(int minIndexSize, float minSizeRatio)
QueryCachingPolicy.CacheOnLargeSegmentsinstance that only caches on a given segment if the total number of documents in the index is greater than
minIndexSizeand the number of documents in the segment divided by the total number of documents in the index is greater than or equal to
public void onUse(Query query)
public boolean shouldCache(Query query, LeafReaderContext context) throws IOException
DocIdSetshould be cached on a given segment. This method will be called on each leaf context to know if the filter should be cached on this particular leaf. The filter cache will first attempt to load a
DocIdSetfrom the cache. If it is not cached yet and this method returns true then a cache entry will be generated. Otherwise an uncached set will be returned.
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.