Skip to content

Commit

Permalink
remove settings related
Browse files Browse the repository at this point in the history
Signed-off-by: Kiran Prakash <[email protected]>
  • Loading branch information
kiranprakash154 committed Mar 12, 2024
1 parent 71eb8db commit c731564
Showing 1 changed file with 0 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.RamUsageEstimator;
import org.opensearch.OpenSearchParseException;
import org.opensearch.common.CheckedSupplier;
import org.opensearch.common.cache.CacheType;
import org.opensearch.common.cache.ICache;
Expand All @@ -53,7 +52,6 @@
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Setting.Property;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.unit.RatioValue;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.util.concurrent.ConcurrentCollections;
import org.opensearch.core.common.bytes.BytesReference;
Expand Down Expand Up @@ -125,17 +123,6 @@ public final class IndicesRequestCache extends AbstractLifecycleComponent
new TimeValue(0),
Property.NodeScope
);
public static final Setting<TimeValue> INDICES_REQUEST_CACHE_CLEAN_INTERVAL_SETTING = Setting.positiveTimeSetting(
"indices.requests.cache.cleanup.interval",
TimeValue.timeValueMinutes(1),
Property.NodeScope
);
public static final Setting<String> INDICES_REQUEST_CACHE_STALENESS_THRESHOLD_SETTING = new Setting<>(
"indices.requests.cache.cleanup.staleness_threshold",
"0%",
IndicesRequestCache::validateStalenessSetting,
Property.NodeScope
);

private final static long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(Key.class);

Expand Down Expand Up @@ -742,26 +729,4 @@ long count() {
int numRegisteredCloseListeners() { // for testing
return registeredClosedListeners.size();
}

/**
* Validates the staleness setting for the cache cleanup threshold.
*
* <p>This method checks if the provided staleness threshold is a valid percentage or a valid double value.
* If the staleness threshold is not valid, it throws an OpenSearchParseException.
*
* @param staleThreshold The staleness threshold to validate.
* @return The validated staleness threshold.
* @throws OpenSearchParseException If the staleness threshold is not a valid percentage or double value.
*
* <p>package private for testing
*/
static String validateStalenessSetting(String staleThreshold) {
try {
RatioValue.parseRatioValue(staleThreshold);
} catch (OpenSearchParseException e) {
e.addSuppressed(e);
throw e;
}
return staleThreshold;
}
}

0 comments on commit c731564

Please sign in to comment.