diff --git a/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java b/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java index c916f33febb22..bd6bba7b784cd 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java +++ b/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java @@ -58,7 +58,6 @@ public final class IndexScopedSettings extends AbstractScopedSettings { public static final Set> BUILT_IN_INDEX_SETTINGS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY, - IndexSettings.INDEX_TTL_DISABLE_PURGE_SETTING, MergeSchedulerConfig.AUTO_THROTTLE_SETTING, MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING, MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING, diff --git a/server/src/main/java/org/elasticsearch/index/IndexSettings.java b/server/src/main/java/org/elasticsearch/index/IndexSettings.java index db661743d9e85..12ded42033e8c 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexSettings.java +++ b/server/src/main/java/org/elasticsearch/index/IndexSettings.java @@ -70,8 +70,6 @@ public final class IndexSettings { (value) -> Translog.Durability.valueOf(value.toUpperCase(Locale.ROOT)), Property.Dynamic, Property.IndexScope); public static final Setting INDEX_WARMER_ENABLED_SETTING = Setting.boolSetting("index.warmer.enabled", true, Property.Dynamic, Property.IndexScope); - public static final Setting INDEX_TTL_DISABLE_PURGE_SETTING = - Setting.boolSetting("index.ttl.disable_purge", false, Property.Dynamic, Property.IndexScope); public static final Setting INDEX_CHECK_ON_STARTUP = new Setting<>("index.shard.check_on_startup", "false", (s) -> { switch(s) { case "false": @@ -292,7 +290,6 @@ public final class IndexSettings { private volatile int maxTokenCount; private volatile int maxNgramDiff; private volatile int maxShingleDiff; - private volatile boolean TTLPurgeDisabled; private volatile TimeValue searchIdleAfter; private volatile int maxAnalyzedOffset; private volatile int maxTermsCount; @@ -403,7 +400,6 @@ public IndexSettings(final IndexMetaData indexMetaData, final Settings nodeSetti maxTokenCount = scopedSettings.get(MAX_TOKEN_COUNT_SETTING); maxNgramDiff = scopedSettings.get(MAX_NGRAM_DIFF_SETTING); maxShingleDiff = scopedSettings.get(MAX_SHINGLE_DIFF_SETTING); - TTLPurgeDisabled = scopedSettings.get(INDEX_TTL_DISABLE_PURGE_SETTING); maxRefreshListeners = scopedSettings.get(MAX_REFRESH_LISTENERS_PER_SHARD); maxSlicesPerScroll = scopedSettings.get(MAX_SLICES_PER_SCROLL); maxAnalyzedOffset = scopedSettings.get(MAX_ANALYZED_OFFSET_SETTING); @@ -426,7 +422,6 @@ public IndexSettings(final IndexMetaData indexMetaData, final Settings nodeSetti mergeSchedulerConfig::setMaxThreadAndMergeCount); scopedSettings.addSettingsUpdateConsumer(MergeSchedulerConfig.AUTO_THROTTLE_SETTING, mergeSchedulerConfig::setAutoThrottle); scopedSettings.addSettingsUpdateConsumer(INDEX_TRANSLOG_DURABILITY_SETTING, this::setTranslogDurability); - scopedSettings.addSettingsUpdateConsumer(INDEX_TTL_DISABLE_PURGE_SETTING, this::setTTLPurgeDisabled); scopedSettings.addSettingsUpdateConsumer(MAX_RESULT_WINDOW_SETTING, this::setMaxResultWindow); scopedSettings.addSettingsUpdateConsumer(MAX_INNER_RESULT_WINDOW_SETTING, this::setMaxInnerResultWindow); scopedSettings.addSettingsUpdateConsumer(MAX_ADJACENCY_MATRIX_FILTERS_SETTING, this::setMaxAdjacencyMatrixFilters); @@ -770,18 +765,6 @@ public MergePolicy getMergePolicy() { return mergePolicyConfig.getMergePolicy(); } - /** - * Returns true if the TTL purge is disabled for this index. Default is false - */ - public boolean isTTLPurgeDisabled() { - return TTLPurgeDisabled; - } - - private void setTTLPurgeDisabled(boolean ttlPurgeDisabled) { - this.TTLPurgeDisabled = ttlPurgeDisabled; - } - - public T getValue(Setting setting) { return scopedSettings.get(setting); } diff --git a/server/src/test/java/org/elasticsearch/index/IndexSettingsTests.java b/server/src/test/java/org/elasticsearch/index/IndexSettingsTests.java index d7ee689b9db56..b7da5add2acf6 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexSettingsTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexSettingsTests.java @@ -405,27 +405,6 @@ public void testGCDeletesSetting() { assertEquals(-1, settings.getGcDeletesInMillis()); } - public void testIsTTLPurgeDisabled() { - IndexMetaData metaData = newIndexMeta("index", Settings.builder() - .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT) - .put(IndexSettings.INDEX_TTL_DISABLE_PURGE_SETTING.getKey(), false) - .build()); - IndexSettings settings = new IndexSettings(metaData, Settings.EMPTY); - assertFalse(settings.isTTLPurgeDisabled()); - settings.updateIndexMetaData(newIndexMeta("index", Settings.builder().put(IndexSettings.INDEX_TTL_DISABLE_PURGE_SETTING.getKey(), - "true").build())); - assertTrue(settings.isTTLPurgeDisabled()); - - settings.updateIndexMetaData(newIndexMeta("index", Settings.EMPTY)); - assertFalse("reset to default", settings.isTTLPurgeDisabled()); - - metaData = newIndexMeta("index", Settings.builder() - .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT) - .build()); - settings = new IndexSettings(metaData, Settings.EMPTY); - assertFalse(settings.isTTLPurgeDisabled()); - } - public void testTranslogFlushSizeThreshold() { ByteSizeValue translogFlushThresholdSize = new ByteSizeValue(Math.abs(randomInt())); ByteSizeValue actualValue = ByteSizeValue.parseBytesSizeValue(translogFlushThresholdSize.getBytes() + "B",