Skip to content

Commit 4cfa376

Browse files
peteralfonsiPeter Alfonsi
and
Peter Alfonsi
authored
[Tiered Caching] Remove PLUGGABLE_CACHE feature flag (#17344) (#17563)
* Remove PLUGGABLE_CACHE feature flag * changelog * move changelog entry * rerun gradle * rerun gradle * fix IT init failure * rerun gradle * rerun gradle * rerun gradle * rerun gradle * rerun gradle --------- Signed-off-by: Peter Alfonsi <petealft@amazon.com> Signed-off-by: Peter Alfonsi <peter.alfonsi@gmail.com> Co-authored-by: Peter Alfonsi <petealft@amazon.com>
1 parent cf525b2 commit 4cfa376

File tree

19 files changed

+61
-220
lines changed

19 files changed

+61
-220
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2929
### Deprecated
3030

3131
### Removed
32+
- Remove FeatureFlags.PLUGGABLE_CACHE as the feature is no longer experimental ([#17344](https://github.com/opensearch-project/OpenSearch/pull/17344))
3233

3334
### Fixed
3435
- Fix case insensitive and escaped query on wildcard ([#16827](https://github.com/opensearch-project/OpenSearch/pull/16827))

distribution/src/config/opensearch.yml

-4
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ ${path.logs}
122122
#
123123
#opensearch.experimental.optimization.datetime_formatter_caching.enabled: false
124124
#
125-
# Gates the functionality of enabling Opensearch to use pluggable caches with respective store names via setting.
126-
#
127-
#opensearch.experimental.feature.pluggable.caching.enabled: false
128-
#
129125
# Gates the functionality of star tree index, which improves the performance of search aggregations.
130126
#
131127
#opensearch.experimental.feature.composite_index.star_tree.enabled: false

modules/cache-common/src/internalClusterTest/java/org/opensearch/cache/common/tier/TieredSpilloverCacheBaseIT.java

-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
import org.opensearch.common.cache.settings.CacheSettings;
1313
import org.opensearch.common.cache.store.OpenSearchOnHeapCache;
1414
import org.opensearch.common.settings.Settings;
15-
import org.opensearch.common.util.FeatureFlags;
1615
import org.opensearch.test.OpenSearchIntegTestCase;
1716

1817
public class TieredSpilloverCacheBaseIT extends OpenSearchIntegTestCase {
1918

2019
public Settings defaultSettings(String onHeapCacheSizeInBytesOrPercentage, int numberOfSegments) {
2120
return Settings.builder()
22-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
2321
.put(
2422
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
2523
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME

modules/cache-common/src/main/java/org/opensearch/cache/common/tier/TieredSpilloverCachePlugin.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.opensearch.common.cache.ICache;
1313
import org.opensearch.common.settings.Setting;
1414
import org.opensearch.common.settings.Settings;
15-
import org.opensearch.common.util.FeatureFlags;
1615
import org.opensearch.plugins.CachePlugin;
1716
import org.opensearch.plugins.Plugin;
1817

@@ -64,9 +63,7 @@ public List<Setting<?>> getSettings() {
6463
);
6564
settingList.add(TOOK_TIME_POLICY_CONCRETE_SETTINGS_MAP.get(cacheType));
6665
settingList.add(TOOK_TIME_DISK_TIER_POLICY_CONCRETE_SETTINGS_MAP.get(cacheType));
67-
if (FeatureFlags.PLUGGABLE_CACHE_SETTING.get(settings)) {
68-
settingList.add(DISK_CACHE_ENABLED_SETTING_MAP.get(cacheType));
69-
}
66+
settingList.add(DISK_CACHE_ENABLED_SETTING_MAP.get(cacheType));
7067
settingList.add(
7168
TieredSpilloverCacheSettings.TIERED_SPILLOVER_SEGMENTS.getConcreteSettingForNamespace(cacheType.getSettingPrefix())
7269
);

modules/cache-common/src/test/java/org/opensearch/cache/common/tier/TieredSpilloverCachePluginTests.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import org.opensearch.common.cache.ICache;
1212
import org.opensearch.common.settings.Settings;
13-
import org.opensearch.common.util.FeatureFlags;
1413
import org.opensearch.test.OpenSearchTestCase;
1514

1615
import java.util.Map;
@@ -24,10 +23,8 @@ public void testGetCacheFactoryMap() {
2423
assertEquals(TieredSpilloverCachePlugin.TIERED_CACHE_SPILLOVER_PLUGIN_NAME, tieredSpilloverCachePlugin.getName());
2524
}
2625

27-
public void testGetSettingsWithFeatureFlagOn() {
28-
TieredSpilloverCachePlugin tieredSpilloverCachePlugin = new TieredSpilloverCachePlugin(
29-
Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE_SETTING.getKey(), true).build()
30-
);
26+
public void testGetSettings() {
27+
TieredSpilloverCachePlugin tieredSpilloverCachePlugin = new TieredSpilloverCachePlugin(Settings.builder().build());
3128
assertFalse(tieredSpilloverCachePlugin.getSettings().isEmpty());
3229
}
3330
}

modules/cache-common/src/test/java/org/opensearch/cache/common/tier/TieredSpilloverCacheTests.java

-13
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.opensearch.common.settings.Setting;
3131
import org.opensearch.common.settings.Settings;
3232
import org.opensearch.common.unit.TimeValue;
33-
import org.opensearch.common.util.FeatureFlags;
3433
import org.opensearch.env.NodeEnvironment;
3534
import org.opensearch.test.OpenSearchTestCase;
3635
import org.junit.Before;
@@ -183,7 +182,6 @@ public void testComputeIfAbsentWithFactoryBasedCacheCreation() throws Exception
183182
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
184183
)
185184
.put(TIERED_SPILLOVER_SEGMENTS.getConcreteSettingForNamespace(CacheType.INDICES_REQUEST_CACHE.getSettingPrefix()).getKey(), 1)
186-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
187185
.build();
188186
String storagePath = getStoragePath(settings);
189187
ICache<String, String> tieredSpilloverICache = new TieredSpilloverCache.TieredSpilloverCacheFactory().create(
@@ -283,7 +281,6 @@ public void testComputeIfAbsentWithSegmentedCache() throws Exception {
283281
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
284282
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
285283
)
286-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
287284
.build();
288285
String storagePath = getStoragePath(settings);
289286
ICache<String, String> tieredSpilloverICache = new TieredSpilloverCache.TieredSpilloverCacheFactory().create(
@@ -406,7 +403,6 @@ public void testWithFactoryCreationWithOnHeapCacheNotPresent() {
406403
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
407404
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
408405
)
409-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
410406
.build();
411407

412408
IllegalArgumentException ex = assertThrows(
@@ -491,7 +487,6 @@ public void testComputeIfAbsentWithEvictionsFromOnHeapCache() throws Exception {
491487
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
492488
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
493489
)
494-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
495490
.put(
496491
TieredSpilloverCacheSettings.TIERED_SPILLOVER_ONHEAP_STORE_SIZE.getConcreteSettingForNamespace(
497492
CacheType.INDICES_REQUEST_CACHE.getSettingPrefix()
@@ -1276,7 +1271,6 @@ public void testConcurrencyForEvictionFlowFromOnHeapToDiskTier() throws Exceptio
12761271
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
12771272
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
12781273
)
1279-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
12801274
.put(
12811275
TieredSpilloverCacheSettings.TIERED_SPILLOVER_ONHEAP_STORE_SIZE.getConcreteSettingForNamespace(
12821276
CacheType.INDICES_REQUEST_CACHE.getSettingPrefix()
@@ -2160,7 +2154,6 @@ public void testWithInvalidSegmentNumber() throws Exception {
21602154
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
21612155
)
21622156
.put(TIERED_SPILLOVER_SEGMENTS.getConcreteSettingForNamespace(CacheType.INDICES_REQUEST_CACHE.getSettingPrefix()).getKey(), 1)
2163-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
21642157
.put(TIERED_SPILLOVER_SEGMENTS.getConcreteSettingForNamespace(CacheType.INDICES_REQUEST_CACHE.getSettingPrefix()).getKey(), 3)
21652158
.build();
21662159
String storagePath = getStoragePath(settings);
@@ -2226,7 +2219,6 @@ public void testWithVeryLowDiskCacheSize() throws Exception {
22262219
).getKey(),
22272220
1L
22282221
)
2229-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
22302222
.put(TIERED_SPILLOVER_SEGMENTS.getConcreteSettingForNamespace(CacheType.INDICES_REQUEST_CACHE.getSettingPrefix()).getKey(), 2)
22312223
.build();
22322224
String storagePath = getStoragePath(settings);
@@ -2285,7 +2277,6 @@ public void testTieredCacheDefaultSegmentCount() {
22852277
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
22862278
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
22872279
)
2288-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
22892280
.build();
22902281
String storagePath = getStoragePath(settings);
22912282

@@ -2365,7 +2356,6 @@ public void testSegmentSizesWhenUsingFactory() {
23652356
).getKey(),
23662357
heapSizeFromImplSetting + "b"
23672358
)
2368-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
23692359
.put(
23702360
TIERED_SPILLOVER_SEGMENTS.getConcreteSettingForNamespace(CacheType.INDICES_REQUEST_CACHE.getSettingPrefix()).getKey(),
23712361
numSegments
@@ -2412,7 +2402,6 @@ public void testSegmentSizesWhenNotUsingFactory() {
24122402
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
24132403
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
24142404
)
2415-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
24162405
// The size setting from the OpenSearchOnHeapCache implementation should not be honored
24172406
.put(
24182407
OpenSearchOnHeapCacheSettings.MAXIMUM_SIZE_IN_BYTES.getConcreteSettingForNamespace(
@@ -2697,7 +2686,6 @@ private TieredSpilloverCache<String, String> initializeTieredSpilloverCache(
26972686
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
26982687
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
26992688
)
2700-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
27012689
.put(settings)
27022690
.build()
27032691
)
@@ -2750,7 +2738,6 @@ private CacheConfig<String, String> getCacheConfig(
27502738
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
27512739
TieredSpilloverCache.TieredSpilloverCacheFactory.TIERED_SPILLOVER_CACHE_NAME
27522740
)
2753-
.put(FeatureFlags.PLUGGABLE_CACHE, "true")
27542741
.put(settings)
27552742
.build()
27562743
)

plugins/cache-ehcache/src/internalClusterTest/java/org/opensearch/cache/EhcacheDiskCacheIT.java

-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.opensearch.common.cache.settings.CacheSettings;
2828
import org.opensearch.common.settings.Settings;
2929
import org.opensearch.common.unit.TimeValue;
30-
import org.opensearch.common.util.FeatureFlags;
3130
import org.opensearch.env.NodeEnvironment;
3231
import org.opensearch.index.cache.request.RequestCacheStats;
3332
import org.opensearch.index.query.QueryBuilders;
@@ -71,11 +70,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
7170
return Arrays.asList(EhcacheCachePlugin.class);
7271
}
7372

74-
@Override
75-
protected Settings featureFlagSettings() {
76-
return Settings.builder().put(super.featureFlagSettings()).put(FeatureFlags.PLUGGABLE_CACHE, "true").build();
77-
}
78-
7973
private Settings defaultSettings(long sizeInBytes, TimeValue expirationTime) {
8074
if (expirationTime == null) {
8175
expirationTime = TimeValue.MAX_VALUE;

plugins/cache-ehcache/src/test/java/org/opensearch/cache/store/disk/EhCacheDiskCacheTests.java

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.opensearch.common.metrics.CounterMetric;
2727
import org.opensearch.common.settings.Settings;
2828
import org.opensearch.common.unit.TimeValue;
29-
import org.opensearch.common.util.FeatureFlags;
3029
import org.opensearch.common.util.io.IOUtils;
3130
import org.opensearch.core.common.bytes.BytesArray;
3231
import org.opensearch.core.common.bytes.BytesReference;
@@ -1221,7 +1220,6 @@ private EhcacheDiskCache<String, String> setupMaxSizeTest(long maxSizeFromSettin
12211220
MockRemovalListener<String, String> listener = new MockRemovalListener<>();
12221221
try (NodeEnvironment env = newNodeEnvironment(Settings.builder().build())) {
12231222
Settings settings = Settings.builder()
1224-
.put(FeatureFlags.PLUGGABLE_CACHE, true)
12251223
.put(
12261224
CacheSettings.getConcreteStoreNameSettingForCacheType(CacheType.INDICES_REQUEST_CACHE).getKey(),
12271225
EhcacheDiskCache.EhcacheDiskCacheFactory.EHCACHE_DISK_CACHE_NAME

server/src/internalClusterTest/java/org/opensearch/indices/CacheStatsAPIIndicesRequestCacheIT.java

+1-16
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
package org.opensearch.indices;
1010

11-
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
12-
1311
import org.opensearch.action.admin.cluster.node.stats.NodesStatsRequest;
1412
import org.opensearch.action.admin.cluster.node.stats.NodesStatsResponse;
1513
import org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;
@@ -25,7 +23,6 @@
2523
import org.opensearch.common.cache.stats.ImmutableCacheStatsHolder;
2624
import org.opensearch.common.settings.Settings;
2725
import org.opensearch.common.unit.TimeValue;
28-
import org.opensearch.common.util.FeatureFlags;
2926
import org.opensearch.common.xcontent.XContentFactory;
3027
import org.opensearch.common.xcontent.XContentHelper;
3128
import org.opensearch.core.xcontent.MediaTypeRegistry;
@@ -35,12 +32,9 @@
3532
import org.opensearch.index.cache.request.RequestCacheStats;
3633
import org.opensearch.index.query.QueryBuilders;
3734
import org.opensearch.test.OpenSearchIntegTestCase;
38-
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
3935
import org.opensearch.test.hamcrest.OpenSearchAssertions;
4036

4137
import java.io.IOException;
42-
import java.util.Arrays;
43-
import java.util.Collection;
4438
import java.util.HashMap;
4539
import java.util.List;
4640
import java.util.Map;
@@ -50,16 +44,7 @@
5044

5145
// Use a single data node to simplify logic about cache stats across different shards.
5246
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 1)
53-
public class CacheStatsAPIIndicesRequestCacheIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
54-
public CacheStatsAPIIndicesRequestCacheIT(Settings settings) {
55-
super(settings);
56-
}
57-
58-
@ParametersFactory
59-
public static Collection<Object[]> parameters() {
60-
return Arrays.<Object[]>asList(new Object[] { Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE, "true").build() });
61-
}
62-
47+
public class CacheStatsAPIIndicesRequestCacheIT extends OpenSearchIntegTestCase {
6348
/**
6449
* Test aggregating by indices, indices+shards, shards, or no levels, and check the resulting stats
6550
* are as we expect.

server/src/internalClusterTest/java/org/opensearch/indices/IndicesRequestCacheIT.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
import org.opensearch.common.settings.Settings;
5858
import org.opensearch.common.time.DateFormatter;
5959
import org.opensearch.common.unit.TimeValue;
60-
import org.opensearch.common.util.FeatureFlags;
6160
import org.opensearch.core.index.Index;
6261
import org.opensearch.core.index.shard.ShardId;
6362
import org.opensearch.env.NodeEnvironment;
@@ -110,9 +109,7 @@ public IndicesRequestCacheIT(Settings settings) {
110109
public static Collection<Object[]> parameters() {
111110
return Arrays.asList(
112111
new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), false).build() },
113-
new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), true).build() },
114-
new Object[] { Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE, "true").build() },
115-
new Object[] { Settings.builder().put(FeatureFlags.PLUGGABLE_CACHE, "false").build() }
112+
new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), true).build() }
116113
);
117114
}
118115

server/src/main/java/org/opensearch/common/cache/service/CacheService.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.opensearch.common.cache.store.config.CacheConfig;
1919
import org.opensearch.common.settings.Setting;
2020
import org.opensearch.common.settings.Settings;
21-
import org.opensearch.common.util.FeatureFlags;
2221

2322
import java.util.HashMap;
2423
import java.util.Map;
@@ -47,10 +46,9 @@ public CacheService(Map<String, ICache.Factory> cacheStoreTypeFactories, Setting
4746

4847
public <K, V> ICache<K, V> createCache(CacheConfig<K, V> config, CacheType cacheType) {
4948
String storeName = getStoreNameFromSetting(cacheType, settings);
50-
if (!pluggableCachingEnabled(cacheType, settings)) {
51-
// Condition 1: In case feature flag is off, we default to onHeap.
52-
// Condition 2: In case storeName is not explicitly mentioned, we assume user is looking to use older
53-
// settings, so we again fallback to onHeap to maintain backward compatibility.
49+
if (!storeNamePresent(cacheType, settings)) {
50+
// In case storeName is not explicitly mentioned, we assume user is looking to use older
51+
// settings, so we fallback to onHeap to maintain backward compatibility.
5452
// It is guaranteed that we will have this store name registered, so
5553
// should be safe.
5654
storeName = OpenSearchOnHeapCache.OpenSearchOnHeapCacheFactory.NAME;
@@ -73,11 +71,11 @@ public NodeCacheStats stats(CommonStatsFlags flags) {
7371
}
7472

7573
/**
76-
* Check if pluggable caching is on, and if a store type is present for this cache type.
74+
* Check if a store type is present for this cache type.
7775
*/
78-
public static boolean pluggableCachingEnabled(CacheType cacheType, Settings settings) {
76+
public static boolean storeNamePresent(CacheType cacheType, Settings settings) {
7977
String storeName = getStoreNameFromSetting(cacheType, settings);
80-
return FeatureFlags.PLUGGABLE_CACHE_SETTING.get(settings) && storeName != null && !storeName.isBlank();
78+
return storeName != null && !storeName.isBlank();
8179
}
8280

8381
private static String getStoreNameFromSetting(CacheType cacheType, Settings settings) {

server/src/main/java/org/opensearch/common/cache/store/OpenSearchOnHeapCache.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.opensearch.common.settings.Setting;
3030
import org.opensearch.common.settings.Settings;
3131
import org.opensearch.common.unit.TimeValue;
32-
import org.opensearch.common.util.FeatureFlags;
3332
import org.opensearch.core.common.unit.ByteSizeValue;
3433

3534
import java.util.List;
@@ -182,7 +181,7 @@ public static class OpenSearchOnHeapCacheFactory implements Factory {
182181
public <K, V> ICache<K, V> create(CacheConfig<K, V> config, CacheType cacheType, Map<String, Factory> cacheFactories) {
183182
Map<String, Setting<?>> settingList = OpenSearchOnHeapCacheSettings.getSettingListForCacheType(cacheType);
184183
Settings settings = config.getSettings();
185-
boolean statsTrackingEnabled = statsTrackingEnabled(config.getSettings(), config.getStatsTrackingEnabled());
184+
boolean statsTrackingEnabled = config.getStatsTrackingEnabled();
186185
ICacheBuilder<K, V> builder = new Builder<K, V>().setDimensionNames(config.getDimensionNames())
187186
.setStatsTrackingEnabled(statsTrackingEnabled)
188187
.setExpireAfterAccess(((TimeValue) settingList.get(EXPIRE_AFTER_ACCESS_KEY).get(settings)))
@@ -197,7 +196,7 @@ public <K, V> ICache<K, V> create(CacheConfig<K, V> config, CacheType cacheType,
197196
/*
198197
Use the cache config value if present.
199198
This can be passed down from the TieredSpilloverCache when creating individual segments,
200-
but is not passed in from the IRC if pluggable caching is on.
199+
but is not passed in from the IRC if a store name setting is present.
201200
*/
202201
builder.setMaximumWeightInBytes(config.getMaxSizeInBytes());
203202
} else {
@@ -209,7 +208,7 @@ public <K, V> ICache<K, V> create(CacheConfig<K, V> config, CacheType cacheType,
209208
builder.setNumberOfSegments(-1); // By default it will use 256 segments.
210209
}
211210

212-
if (!CacheService.pluggableCachingEnabled(cacheType, settings)) {
211+
if (!CacheService.storeNamePresent(cacheType, settings)) {
213212
// For backward compatibility as the user intent is to use older settings.
214213
builder.setMaximumWeightInBytes(config.getMaxSizeInBytes());
215214
builder.setExpireAfterAccess(config.getExpireAfterAccess());
@@ -223,11 +222,6 @@ public <K, V> ICache<K, V> create(CacheConfig<K, V> config, CacheType cacheType,
223222
public String getCacheName() {
224223
return NAME;
225224
}
226-
227-
private boolean statsTrackingEnabled(Settings settings, boolean statsTrackingEnabledConfig) {
228-
// Don't track stats when pluggable caching is off, or when explicitly set to false in the CacheConfig
229-
return FeatureFlags.PLUGGABLE_CACHE_SETTING.get(settings) && statsTrackingEnabledConfig;
230-
}
231225
}
232226

233227
/**

0 commit comments

Comments
 (0)