From 3a5d3a3bb0d2b3b4aee2ea5ba0839f315653379f Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 22 Dec 2015 09:39:12 +0100 Subject: [PATCH] Remove deprecated query cache settings --- .../elasticsearch/cluster/ClusterModule.java | 1 - .../cache/request/IndicesRequestCache.java | 31 ++----------------- docs/reference/migration/migrate_3_0.asciidoc | 5 +++ 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/cluster/ClusterModule.java b/core/src/main/java/org/elasticsearch/cluster/ClusterModule.java index 42517854f08..59b33bb03d1 100644 --- a/core/src/main/java/org/elasticsearch/cluster/ClusterModule.java +++ b/core/src/main/java/org/elasticsearch/cluster/ClusterModule.java @@ -186,7 +186,6 @@ public class ClusterModule extends AbstractModule { registerIndexDynamicSetting(IndexSettings.INDEX_TRANSLOG_DURABILITY, Validator.EMPTY); registerIndexDynamicSetting(IndicesWarmer.INDEX_WARMER_ENABLED, Validator.EMPTY); registerIndexDynamicSetting(IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED, Validator.BOOLEAN); - registerIndexDynamicSetting(IndicesRequestCache.DEPRECATED_INDEX_CACHE_REQUEST_ENABLED, Validator.BOOLEAN); registerIndexDynamicSetting(UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING, Validator.TIME); registerIndexDynamicSetting(DefaultSearchContext.MAX_RESULT_WINDOW, Validator.POSITIVE_INTEGER); } 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 d783fcd96e3..a00cc7e787c 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,13 +79,9 @@ public class IndicesRequestCache extends AbstractComponent implements RemovalLis * since we are checking on the cluster state IndexMetaData always. */ public static final String INDEX_CACHE_REQUEST_ENABLED = "index.requests.cache.enable"; - @Deprecated - public static final String DEPRECATED_INDEX_CACHE_REQUEST_ENABLED = "index.cache.query.enable"; public static final String INDICES_CACHE_REQUEST_CLEAN_INTERVAL = "indices.requests.cache.clean_interval"; public static final String INDICES_CACHE_QUERY_SIZE = "indices.requests.cache.size"; - @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"; private static final Set CACHEABLE_SEARCH_TYPES = EnumSet.of(SearchType.QUERY_THEN_FETCH, SearchType.QUERY_AND_FETCH); @@ -113,19 +109,7 @@ public class IndicesRequestCache extends AbstractComponent implements RemovalLis this.threadPool = threadPool; this.cleanInterval = settings.getAsTime(INDICES_CACHE_REQUEST_CLEAN_INTERVAL, TimeValue.timeValueSeconds(60)); - String size = settings.get(INDICES_CACHE_QUERY_SIZE); - if (size == null) { - size = settings.get(DEPRECATED_INDICES_CACHE_QUERY_SIZE); - if (size != null) { - deprecationLogger.deprecated("The [" + DEPRECATED_INDICES_CACHE_QUERY_SIZE - + "] settings is now deprecated, use [" + INDICES_CACHE_QUERY_SIZE + "] instead"); - } - } - if (size == null) { - // this cache can be very small yet still be very effective - size = "1%"; - } - this.size = size; + this.size = settings.get(INDICES_CACHE_QUERY_SIZE, "1%"); this.expire = settings.getAsTime(INDICES_CACHE_QUERY_EXPIRE, null); buildCache(); @@ -135,18 +119,7 @@ public class IndicesRequestCache extends AbstractComponent implements RemovalLis } private boolean isCacheEnabled(Settings settings, boolean defaultEnable) { - Boolean enable = settings.getAsBoolean(INDEX_CACHE_REQUEST_ENABLED, null); - if (enable == null) { - enable = settings.getAsBoolean(DEPRECATED_INDEX_CACHE_REQUEST_ENABLED, null); - if (enable != null) { - deprecationLogger.deprecated("The [" + DEPRECATED_INDEX_CACHE_REQUEST_ENABLED - + "] settings is now deprecated, use [" + INDEX_CACHE_REQUEST_ENABLED + "] instead"); - } - } - if (enable == null) { - enable = defaultEnable; - } - return enable; + return settings.getAsBoolean(INDEX_CACHE_REQUEST_ENABLED, defaultEnable); } private void buildCache() { diff --git a/docs/reference/migration/migrate_3_0.asciidoc b/docs/reference/migration/migrate_3_0.asciidoc index 8b6775b082c..d53740c198b 100644 --- a/docs/reference/migration/migrate_3_0.asciidoc +++ b/docs/reference/migration/migrate_3_0.asciidoc @@ -206,6 +206,11 @@ The `index.translog.flush_threshold_ops` setting is not supported anymore. In or growth use `index.translog.flush_threshold_size` instead. Changing the translog type with `index.translog.fs.type` is not supported anymore, the `buffered` implementation is now the only available option and uses a fixed `8kb` buffer. +==== Request Cache Settings + +The deprecated settings `index.cache.query.enable` and `indices.cache.query.size` have been removed and are replaced with +`index.requests.cache.enable` and `indices.requests.cache.size` respectively. + [[breaking_30_mapping_changes]] === Mapping changes