Skip to content

Commit

Permalink
Update IndicesRequestCache.java
Browse files Browse the repository at this point in the history
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
  • Loading branch information
kiranprakash154 committed Apr 25, 2024
1 parent a3c12cd commit b07278f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public final class IndicesRequestCache implements RemovalListener<ICacheKey<Indi
private final Function<ShardId, Optional<CacheEntity>> cacheEntityLookup;
// pkg-private for testing
final IndicesRequestCacheCleanupManager cacheCleanupManager;

// These values determine the valid names for levels in the cache stats API
public static final String SHARD_ID_DIMENSION_NAME = "shards";
public static final String INDEX_DIMENSION_NAME = "indices";
Expand Down Expand Up @@ -532,7 +533,7 @@ void enqueueCleanupKey(CleanupKey cleanupKey) {
* @param cleanupKey the CleanupKey to be updated in the map
*/
private void updateStaleCountOnCacheInsert(CleanupKey cleanupKey) {
if (stalenessThreshold == 0.0 || cleanupKey.entity == null) {
if (cleanupKey.entity == null) {
return;
}
IndexShard indexShard = (IndexShard) cleanupKey.entity.getCacheIdentity();
Expand Down

0 comments on commit b07278f

Please sign in to comment.