From 18b32f0ba5fd2a1e3771e2efe002cb999889ef7b Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 20 Oct 2015 10:12:48 -0400 Subject: [PATCH] Remove cache concurrency level settings that no longer apply This commit removes some cache concurrency level settings that were applicable when the cache was backed by the Guava cache implementation, but no longer apply with the cache implementation completed in #13717. Relates #7836, relates #13224, relates #13717 --- .../indices/cache/request/IndicesRequestCache.java | 7 ------- .../indices/fielddata/cache/IndicesFieldDataCache.java | 1 - .../java/org/elasticsearch/test/InternalTestCluster.java | 4 ---- docs/reference/migration/migrate_3_0.asciidoc | 6 ++++++ 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/indices/cache/request/IndicesRequestCache.java b/core/src/main/java/org/elasticsearch/indices/cache/request/IndicesRequestCache.java index 4ce8af360d3..723c36e30ec 100644 --- a/core/src/main/java/org/elasticsearch/indices/cache/request/IndicesRequestCache.java +++ b/core/src/main/java/org/elasticsearch/indices/cache/request/IndicesRequestCache.java @@ -79,7 +79,6 @@ public class IndicesRequestCache extends AbstractComponent implements RemovalLis @Deprecated public static final String DEPRECATED_INDICES_CACHE_QUERY_SIZE = "indices.cache.query.size"; public static final String INDICES_CACHE_QUERY_EXPIRE = "indices.requests.cache.expire"; - public static final String INDICES_CACHE_QUERY_CONCURRENCY_LEVEL = "indices.requests.cache.concurrency_level"; private static final Set CACHEABLE_SEARCH_TYPES = EnumSet.of(SearchType.QUERY_THEN_FETCH, SearchType.QUERY_AND_FETCH); @@ -96,7 +95,6 @@ public class IndicesRequestCache extends AbstractComponent implements RemovalLis //TODO make these changes configurable on the cluster level private final String size; private final TimeValue expire; - private final int concurrencyLevel; private volatile Cache cache; @@ -122,11 +120,6 @@ public class IndicesRequestCache extends AbstractComponent implements RemovalLis this.size = size; this.expire = settings.getAsTime(INDICES_CACHE_QUERY_EXPIRE, null); - // defaults to 4, but this is a busy map for all indices, increase it a bit by default - this.concurrencyLevel = settings.getAsInt(INDICES_CACHE_QUERY_CONCURRENCY_LEVEL, 16); - if (concurrencyLevel <= 0) { - throw new IllegalArgumentException("concurrency_level must be > 0 but was: " + concurrencyLevel); - } buildCache(); this.reaper = new Reaper(); diff --git a/core/src/main/java/org/elasticsearch/indices/fielddata/cache/IndicesFieldDataCache.java b/core/src/main/java/org/elasticsearch/indices/fielddata/cache/IndicesFieldDataCache.java index 74940cfb5b7..73095f8ee5d 100644 --- a/core/src/main/java/org/elasticsearch/indices/fielddata/cache/IndicesFieldDataCache.java +++ b/core/src/main/java/org/elasticsearch/indices/fielddata/cache/IndicesFieldDataCache.java @@ -55,7 +55,6 @@ import java.util.function.ToLongBiFunction; public class IndicesFieldDataCache extends AbstractComponent implements RemovalListener { public static final String FIELDDATA_CLEAN_INTERVAL_SETTING = "indices.fielddata.cache.cleanup_interval"; - public static final String FIELDDATA_CACHE_CONCURRENCY_LEVEL = "indices.fielddata.cache.concurrency_level"; public static final String INDICES_FIELDDATA_CACHE_SIZE_KEY = "indices.fielddata.cache.size"; diff --git a/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java b/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java index 22973d425a3..b61e41fdf8f 100644 --- a/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java +++ b/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java @@ -478,10 +478,6 @@ public final class InternalTestCluster extends TestCluster { builder.put(RecoverySettings.INDICES_RECOVERY_COMPRESS, random.nextBoolean()); } - if (random.nextBoolean()) { - builder.put(IndicesRequestCache.INDICES_CACHE_QUERY_CONCURRENCY_LEVEL, RandomInts.randomIntBetween(random, 1, 32)); - builder.put(IndicesFieldDataCache.FIELDDATA_CACHE_CONCURRENCY_LEVEL, RandomInts.randomIntBetween(random, 1, 32)); - } if (random.nextBoolean()) { builder.put(NettyTransport.PING_SCHEDULE, RandomInts.randomIntBetween(random, 100, 2000) + "ms"); } diff --git a/docs/reference/migration/migrate_3_0.asciidoc b/docs/reference/migration/migrate_3_0.asciidoc index e87d5de24e1..8fb3c6bc939 100644 --- a/docs/reference/migration/migrate_3_0.asciidoc +++ b/docs/reference/migration/migrate_3_0.asciidoc @@ -312,3 +312,9 @@ For simplicity, only one way of adding the ids to the existing list (empty by de `DocumentAlreadyExistsException` is removed and a `VersionConflictException` is thrown instead (with a better error description). This will influence code that use the `IndexRequest.opType()` or `IndexRequest.create()` to index a document only if it doesn't already exist. + +=== Cache concurrency level settings removed + +Two cache concurrency level settings `indices.requests.cache.concurrency_level` and +`indices.fielddata.cache.concurrency_level` because they no longer apply to the cache implementation used for the +request cache and the field data cache.