From f46e66e7d09275ba3009e41f5cf20b7acd5de40e Mon Sep 17 00:00:00 2001 From: xuzha Date: Thu, 27 Aug 2015 21:07:56 -0700 Subject: [PATCH] Remove the experimental indices.fielddata.cache.expire closes #10781 --- .../indices/fielddata/cache/IndicesFieldDataCache.java | 8 ++------ .../java/org/elasticsearch/test/InternalTestCluster.java | 3 --- docs/reference/migration/migrate_2_1.asciidoc | 7 +++++++ docs/reference/modules/indices/fielddata.asciidoc | 6 ------ 4 files changed, 9 insertions(+), 15 deletions(-) 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 4e764654603..1bf020315c5 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 @@ -54,7 +54,6 @@ public class IndicesFieldDataCache extends AbstractComponent implements RemovalL 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"; - public static final String INDICES_FIELDDATA_CACHE_EXPIRE_KEY = "indices.fielddata.cache.expire"; private final IndicesFieldDataCacheListener indicesFieldDataCacheListener; @@ -70,7 +69,6 @@ public class IndicesFieldDataCache extends AbstractComponent implements RemovalL this.indicesFieldDataCacheListener = indicesFieldDataCacheListener; final String size = settings.get(INDICES_FIELDDATA_CACHE_SIZE_KEY, "-1"); final long sizeInBytes = settings.getAsMemory(INDICES_FIELDDATA_CACHE_SIZE_KEY, "-1").bytes(); - final TimeValue expire = settings.getAsTime(INDICES_FIELDDATA_CACHE_EXPIRE_KEY, null); CacheBuilder cacheBuilder = CacheBuilder.newBuilder() .removalListener(this); if (sizeInBytes > 0) { @@ -82,10 +80,8 @@ public class IndicesFieldDataCache extends AbstractComponent implements RemovalL throw new IllegalArgumentException("concurrency_level must be > 0 but was: " + concurrencyLevel); } cacheBuilder.concurrencyLevel(concurrencyLevel); - if (expire != null && expire.millis() > 0) { - cacheBuilder.expireAfterAccess(expire.millis(), TimeUnit.MILLISECONDS); - } - logger.debug("using size [{}] [{}], expire [{}]", size, new ByteSizeValue(sizeInBytes), expire); + + logger.debug("using size [{}] [{}]", size, new ByteSizeValue(sizeInBytes)); cache = cacheBuilder.build(); this.cleanInterval = settings.getAsTime(FIELDDATA_CLEAN_INTERVAL_SETTING, TimeValue.timeValueMinutes(1)); diff --git a/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java b/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java index f54197b039a..07aef2125d4 100644 --- a/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java +++ b/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java @@ -432,9 +432,6 @@ public final class InternalTestCluster extends TestCluster { if (random.nextBoolean()) { builder.put("indices.fielddata.cache.size", 1 + random.nextInt(1000), ByteSizeUnit.MB); } - if (random.nextBoolean()) { - builder.put("indices.fielddata.cache.expire", TimeValue.timeValueMillis(1 + random.nextInt(10000))); - } } // randomize netty settings diff --git a/docs/reference/migration/migrate_2_1.asciidoc b/docs/reference/migration/migrate_2_1.asciidoc index 63092d9250e..a530fc1193d 100644 --- a/docs/reference/migration/migrate_2_1.asciidoc +++ b/docs/reference/migration/migrate_2_1.asciidoc @@ -35,3 +35,10 @@ We've switched the default value of the `detect_noop` option from `false` to source unless you explicitly set `"detect_noop": false`. `detect_noop` was always computationally cheap compared to the expense of the update which can be thought of as a delete operation followed by an index operation. + +=== Removed features + +==== `indices.fielddata.cache.expire` + +The experimental feature `indices.fielddata.cache.expire` has been removed. +For indices that have this setting configured, this config will be ignored. \ No newline at end of file diff --git a/docs/reference/modules/indices/fielddata.asciidoc b/docs/reference/modules/indices/fielddata.asciidoc index eda1ff48e79..e8c8a8d2c49 100644 --- a/docs/reference/modules/indices/fielddata.asciidoc +++ b/docs/reference/modules/indices/fielddata.asciidoc @@ -18,12 +18,6 @@ and perform poorly. absolute value, eg `12GB`. Defaults to unbounded. Also see <>. -`indices.fielddata.cache.expire`:: - - experimental[] A time based setting that expires field data after a - certain time of inactivity. Defaults to `-1`. For example, can be set to - `5m` for a 5 minute expiry. - NOTE: These are static settings which must be configured on every data node in the cluster.