From 268797fa322c91293204ecc7c4fdb8a449f9b5f8 Mon Sep 17 00:00:00 2001 From: Kiran Prakash Date: Thu, 28 Mar 2024 18:30:30 -0700 Subject: [PATCH] Update IndicesRequestCache.java Signed-off-by: Kiran Prakash --- .../org/opensearch/indices/IndicesRequestCache.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java index 269d27e43fb50..abc77bb19a312 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java @@ -108,6 +108,10 @@ public final class IndicesRequestCache implements RemovalListener INDEX_CACHE_REQUEST_ENABLED_SETTING = Setting.boolSetting( "index.requests.cache.enable", true, @@ -125,12 +129,12 @@ public final class IndicesRequestCache implements RemovalListener INDICES_REQUEST_CACHE_CLEAN_INTERVAL_SETTING = Setting.positiveTimeSetting( - "indices.requests.cache.cleanup.interval", + SETTING_INDICES_REQUEST_CACHE_CLEAN_INTERVAL_SETTING, INDICES_CACHE_CLEAN_INTERVAL_SETTING, Property.NodeScope ); public static final Setting INDICES_REQUEST_CACHE_STALENESS_THRESHOLD_SETTING = new Setting<>( - "indices.requests.cache.cleanup.staleness_threshold", + SETTING_INDICES_REQUEST_CACHE_STALENESS_THRESHOLD_SETTING, "0%", IndicesRequestCache::validateStalenessSetting, Property.Dynamic, @@ -452,7 +456,7 @@ class IndicesRequestCacheCleanupManager implements Closeable { private final Set keysToClean; private final ConcurrentMap> cleanupKeyToCountMap; private final AtomicInteger staleKeysCount; - private double stalenessThreshold; + private volatile double stalenessThreshold; private final IndicesRequestCacheCleaner cacheCleaner; IndicesRequestCacheCleanupManager(ThreadPool threadpool, TimeValue cleanInterval, double stalenessThreshold) {