From f23795533cd43c38d55ae7d5e5272c1a70019c21 Mon Sep 17 00:00:00 2001 From: Kiran Prakash Date: Wed, 27 Mar 2024 00:15:22 -0700 Subject: [PATCH] spotless Signed-off-by: Kiran Prakash --- .../indices/IndicesRequestCacheIT.java | 19 +++++++------------ .../indices/IndicesRequestCache.java | 3 ++- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/IndicesRequestCacheIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/IndicesRequestCacheIT.java index 593a98ffe301a..547e71eba51a4 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/IndicesRequestCacheIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/IndicesRequestCacheIT.java @@ -84,10 +84,10 @@ public IndicesRequestCacheIT(Settings settings) { @ParametersFactory public static Collection parameters() { return Arrays.asList( - new Object[]{Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), false).build()}, - new Object[]{Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), true).build()}, - new Object[]{Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE, "true").build()}, - new Object[]{Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE, "false").build()} + new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), false).build() }, + new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), true).build() }, + new Object[] { Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE, "true").build() }, + new Object[] { Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE, "false").build() } ); } @@ -109,7 +109,8 @@ public void testCacheAggs() throws Exception { .put(IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING.getKey(), true) .put(SETTING_NUMBER_OF_SHARDS, 1) .put(SETTING_NUMBER_OF_REPLICAS, 0) - ).get() + ) + .get() ); indexRandom( true, @@ -1106,12 +1107,6 @@ private static void assertCacheState(Client client, String index, long expectedH } private static RequestCacheStats getRequestCacheStats(Client client, String index) { - return client.admin() - .indices() - .prepareStats(index) - .setRequestCache(true) - .get() - .getTotal() - .getRequestCache(); + return client.admin().indices().prepareStats(index).setRequestCache(true).get().getTotal().getRequestCache(); } } diff --git a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java index 5609254dbf7f2..8521f4d5e03e2 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java @@ -108,7 +108,8 @@ public final class IndicesRequestCache implements RemovalListener INDEX_CACHE_REQUEST_ENABLED_SETTING = Setting.boolSetting(