Rename retention lease setting (#39719)

This commit renames the retention lease setting
index.soft_deletes.retention.lease so that it is under the namespace
index.soft_deletes.retention_lease. As such, we rename the setting to
index.soft_deletes.retention_lease.period.
This commit is contained in:
Jason Tedor 2019-03-05 22:02:31 -05:00
parent 504c792861
commit 75a0d4f470
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5
6 changed files with 11 additions and 11 deletions

View File

@ -134,7 +134,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
IndexSettings.INDEX_GC_DELETES_SETTING,
IndexSettings.INDEX_SOFT_DELETES_SETTING,
IndexSettings.INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING,
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING,
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING,
IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING,
UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING,
EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE_SETTING,

View File

@ -261,9 +261,9 @@ public final class IndexSettings {
/**
* Controls the maximum length of time since a retention lease is created or renewed before it is considered expired.
*/
public static final Setting<TimeValue> INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING =
public static final Setting<TimeValue> INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING =
Setting.timeSetting(
"index.soft_deletes.retention.lease",
"index.soft_deletes.retention_lease.period",
TimeValue.timeValueHours(12),
TimeValue.ZERO,
Property.Dynamic,
@ -460,7 +460,7 @@ public final class IndexSettings {
gcDeletesInMillis = scopedSettings.get(INDEX_GC_DELETES_SETTING).getMillis();
softDeleteEnabled = version.onOrAfter(Version.V_6_5_0) && scopedSettings.get(INDEX_SOFT_DELETES_SETTING);
softDeleteRetentionOperations = scopedSettings.get(INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING);
retentionLeaseMillis = scopedSettings.get(INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING).millis();
retentionLeaseMillis = scopedSettings.get(INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING).millis();
warmerEnabled = scopedSettings.get(INDEX_WARMER_ENABLED_SETTING);
maxResultWindow = scopedSettings.get(MAX_RESULT_WINDOW_SETTING);
maxInnerResultWindow = scopedSettings.get(MAX_INNER_RESULT_WINDOW_SETTING);
@ -529,7 +529,7 @@ public final class IndexSettings {
scopedSettings.addSettingsUpdateConsumer(DEFAULT_PIPELINE, this::setDefaultPipeline);
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING, this::setSoftDeleteRetentionOperations);
scopedSettings.addSettingsUpdateConsumer(INDEX_SEARCH_THROTTLED, this::setSearchThrottled);
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING, this::setRetentionLeaseMillis);
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING, this::setRetentionLeaseMillis);
}
private void setSearchIdleAfter(TimeValue searchIdleAfter) { this.searchIdleAfter = searchIdleAfter; }

View File

@ -337,7 +337,7 @@ public class ReplicationTrackerRetentionLeaseTests extends ReplicationTrackerTes
final Settings settings = Settings
.builder()
.put(
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(),
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(),
TimeValue.timeValueMillis(retentionLeaseMillis))
.build();
final long primaryTerm = randomLongBetween(1, Long.MAX_VALUE);

View File

@ -210,7 +210,7 @@ public class RetentionLeaseIT extends ESIntegTestCase {
.prepareUpdateSettings("index")
.setSettings(
Settings.builder()
.putNull(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey())
.putNull(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey())
.build())
.get();
assertTrue(longTtlResponse.isAcknowledged());
@ -240,7 +240,7 @@ public class RetentionLeaseIT extends ESIntegTestCase {
.prepareUpdateSettings("index")
.setSettings(
Settings.builder()
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(), retentionLeaseTimeToLive)
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(), retentionLeaseTimeToLive)
.build())
.get();
assertTrue(shortTtlResponse.isAcknowledged());

View File

@ -144,7 +144,7 @@ public class IndexShardRetentionLeaseTests extends IndexShardTestCase {
final Settings settings = Settings
.builder()
.put(
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(),
IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(),
TimeValue.timeValueMillis(retentionLeaseMillis))
.build();
// current time is mocked through the thread pool
@ -211,7 +211,7 @@ public class IndexShardRetentionLeaseTests extends IndexShardTestCase {
public void testPersistence() throws IOException {
final Settings settings = Settings.builder()
.put(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true)
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING.getKey(), Long.MAX_VALUE, TimeUnit.NANOSECONDS)
.put(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING.getKey(), Long.MAX_VALUE, TimeUnit.NANOSECONDS)
.build();
final IndexShard indexShard = newStartedShard(
true,

View File

@ -386,7 +386,7 @@ public class TransportResumeFollowAction extends TransportMasterNodeAction<Resum
nonReplicatedSettings.add(IndexSettings.ALLOW_UNMAPPED);
nonReplicatedSettings.add(IndexSettings.INDEX_SEARCH_IDLE_AFTER);
nonReplicatedSettings.add(IndexSettings.INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING);
nonReplicatedSettings.add(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_SETTING);
nonReplicatedSettings.add(IndexSettings.INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING);
nonReplicatedSettings.add(IndexSettings.MAX_SCRIPT_FIELDS_SETTING);
nonReplicatedSettings.add(IndexSettings.MAX_REGEX_LENGTH_SETTING);
nonReplicatedSettings.add(IndexSettings.MAX_TERMS_COUNT_SETTING);