DocIdSet get(Query key, LeafReaderContext context, IndexReader.CacheHelper cacheHelper) { assert lock.isHeldByCurrentThread(); assert key instanceof BoostQuery == false; assert key instanceof ConstantScoreQuery == false; final IndexReader.CacheKey readerKey = cacheHelper.getKey(); final LeafCache leafCache = cache.get(readerKey); if (leafCache == null) { onMiss(readerKey, key); return null; } // this get call moves the query to the most-recently-used position final Query singleton = uniqueQueries.get(key); if (singleton == null) { onMiss(readerKey, key); return null; } final DocIdSet cached = leafCache.get(singleton); if (cached == null) { onMiss(readerKey, singleton); } else { onHit(readerKey, singleton); } return cached; }
@Override protected void onMiss(Object readerCoreKey, Query filter) { super.onMiss(readerCoreKey, filter); final Stats shardStats = getOrCreateStats(readerCoreKey); shardStats.missCount += 1; } }
@Override protected void onMiss(Object readerCoreKey, Query filter) { super.onMiss(readerCoreKey, filter); final Stats shardStats = getOrCreateStats(readerCoreKey); shardStats.missCount += 1; } }
@Override protected void onMiss(Object readerCoreKey, Query filter) { super.onMiss(readerCoreKey, filter); final Stats shardStats = getOrCreateStats(readerCoreKey); shardStats.missCount += 1; } }
@Override protected void onMiss(Object readerCoreKey, Query filter) { assert Thread.holdsLock(this); super.onMiss(readerCoreKey, filter); final Stats shardStats = getOrCreateStats(readerCoreKey); shardStats.missCount += 1; } };
@Override protected void onMiss(Object readerCoreKey, Query filter) { super.onMiss(readerCoreKey, filter); final Stats shardStats = getOrCreateStats(readerCoreKey); shardStats.missCount += 1; } }
DocIdSet get(Query key, LeafReaderContext context, IndexReader.CacheHelper cacheHelper) { assert lock.isHeldByCurrentThread(); assert key instanceof BoostQuery == false; assert key instanceof ConstantScoreQuery == false; final IndexReader.CacheKey readerKey = cacheHelper.getKey(); final LeafCache leafCache = cache.get(readerKey); if (leafCache == null) { onMiss(readerKey, key); return null; } // this get call moves the query to the most-recently-used position final Query singleton = uniqueQueries.get(key); if (singleton == null) { onMiss(readerKey, key); return null; } final DocIdSet cached = leafCache.get(singleton); if (cached == null) { onMiss(readerKey, singleton); } else { onHit(readerKey, singleton); } return cached; }
synchronized DocIdSet get(Query key, LeafReaderContext context) { assert key.getBoost() == 1f; assert key instanceof BoostQuery == false; assert key instanceof ConstantScoreQuery == false; final Object readerKey = context.reader().getCoreCacheKey(); final LeafCache leafCache = cache.get(readerKey); if (leafCache == null) { onMiss(readerKey, key); return null; } // this get call moves the query to the most-recently-used position final Query singleton = uniqueQueries.get(key); if (singleton == null) { onMiss(readerKey, key); return null; } final DocIdSet cached = leafCache.get(singleton); if (cached == null) { onMiss(readerKey, singleton); } else { onHit(readerKey, singleton); } return cached; }
synchronized DocIdSet get(Query key, LeafReaderContext context) { assert key.getBoost() == 1f; assert key instanceof BoostQuery == false; assert key instanceof ConstantScoreQuery == false; final Object readerKey = context.reader().getCoreCacheKey(); final LeafCache leafCache = cache.get(readerKey); if (leafCache == null) { onMiss(readerKey, key); return null; } // this get call moves the query to the most-recently-used position final Query singleton = uniqueQueries.get(key); if (singleton == null) { onMiss(readerKey, key); return null; } final DocIdSet cached = leafCache.get(singleton); if (cached == null) { onMiss(readerKey, singleton); } else { onHit(readerKey, singleton); } return cached; }