Skip to content

Commit c8e676a

Browse files
authored
Rebranding user facing DLM references (#96866)
Part of bigger rebranding effort (#96875)
1 parent 7b1b81a commit c8e676a

File tree

26 files changed

+100
-78
lines changed

26 files changed

+100
-78
lines changed

docs/reference/dlm/apis/explain-data-lifecycle.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ GET .ds-metrics-2023.03.22-000001/_lifecycle/explain
5555
--------------------------------------------------
5656
// TEST[skip:we're not setting up DLM in these tests]
5757

58-
If the index is managed by DLM `explain` will show the `managed_by_dlm` field
58+
If the index is managed by DLM `explain` will show the `managed_by_lifecycle` field
5959
set to `true` and the rest of the response will contain information about the
6060
lifecycle execution status for this index:
6161

@@ -65,7 +65,7 @@ lifecycle execution status for this index:
6565
"indices": {
6666
".ds-metrics-2023.03.22-000001": {
6767
"index" : ".ds-metrics-2023.03.22-000001",
68-
"managed_by_dlm" : true, <1>
68+
"managed_by_lifecycle" : true, <1>
6969
"index_creation_date_millis" : 1679475563571, <2>
7070
"time_since_index_creation" : "843ms", <3>
7171
"rollover_date_millis" : 1679475564293, <4>
@@ -104,7 +104,7 @@ index:
104104
"indices": {
105105
".ds-metrics-2023.03.22-000001": {
106106
"index" : ".ds-metrics-2023.03.22-000001",
107-
"managed_by_dlm" : true,
107+
"managed_by_lifecycle" : true,
108108
"index_creation_date_millis" : 1679475563571,
109109
"time_since_index_creation" : "843ms",
110110
"lifecycle" : { },

docs/reference/dlm/apis/get-lifecycle.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ duration the document could be deleted. When undefined, every document in this d
7575
`rollover`::
7676
(Optional, object)
7777
The conditions which will trigger the rollover of a backing index as configured by the cluster setting
78-
`cluster.dlm.default.rollover`. This property is an implementation detail and it will only be retrieved when the query
78+
`cluster.lifecycle.default.rollover`. This property is an implementation detail and it will only be retrieved when the query
7979
param `include_defaults` is set to `true`. The contents of this field are subject to change.
8080
=====
8181
====

docs/reference/indices/get-data-stream.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ duration the document could be deleted. When empty, every document in this data
236236
`rollover`::
237237
(object)
238238
The conditions which will trigger the rollover of a backing index as configured by the cluster setting
239-
`cluster.dlm.default.rollover`. This property is an implementation detail and it will only be retrieved when the query
239+
`cluster.lifecycle.default.rollover`. This property is an implementation detail and it will only be retrieved when the query
240240
param `include_defaults` is set to `true`. The contents of this field are subject to change.
241241
=====
242242
====

modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/GetDataStreamsTransportAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static GetDataStreamAction.Response innerOperation(
181181
return new GetDataStreamAction.Response(
182182
dataStreamInfos,
183183
request.includeDefaults() && DataLifecycle.isEnabled()
184-
? clusterSettings.get(DataLifecycle.CLUSTER_DLM_DEFAULT_ROLLOVER_SETTING)
184+
? clusterSettings.get(DataLifecycle.CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING)
185185
: null
186186
);
187187
}

modules/dlm/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ testClusters.configureEach {
3030
// disable ILM history, since it disturbs tests using _all
3131
setting 'indices.lifecycle.history_index_enabled', 'false'
3232
setting 'xpack.security.enabled', 'true'
33-
setting 'indices.dlm.poll_interval', '1000ms'
33+
setting 'data_streams.lifecycle.poll_interval', '1000ms'
3434
keystore 'bootstrap.password', 'x-pack-test-password'
3535
user username: "x_pack_rest_user", password: "x-pack-test-password"
3636
requiresFeature 'es.dlm_feature_flag_enabled', Version.fromString("8.8.0")

modules/dlm/src/internalClusterTest/java/org/elasticsearch/dlm/DataLifecycleServiceIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ protected boolean ignoreExternalCluster() {
8484
@Override
8585
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
8686
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
87-
settings.put(DataLifecycleService.DLM_POLL_INTERVAL, "1s");
88-
settings.put(DataLifecycle.CLUSTER_DLM_DEFAULT_ROLLOVER_SETTING.getKey(), "min_docs=1,max_docs=1");
87+
settings.put(DataLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL, "1s");
88+
settings.put(DataLifecycle.CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING.getKey(), "min_docs=1,max_docs=1");
8989
return settings.build();
9090
}
9191

@@ -356,7 +356,7 @@ public void testAutomaticForceMerge() throws Exception {
356356
}
357357

358358
private static void disableDLM() {
359-
updateClusterSettings(Settings.builder().put(DataLifecycleService.DLM_POLL_INTERVAL, TimeValue.MAX_VALUE));
359+
updateClusterSettings(Settings.builder().put(DataLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL, TimeValue.MAX_VALUE));
360360
}
361361

362362
public void testErrorRecordingOnRollover() throws Exception {

modules/dlm/src/internalClusterTest/java/org/elasticsearch/dlm/ExplainDataLifecycleIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ protected boolean ignoreExternalCluster() {
6868
@Override
6969
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
7070
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
71-
settings.put(DataLifecycleService.DLM_POLL_INTERVAL, "1s");
72-
settings.put(DataLifecycle.CLUSTER_DLM_DEFAULT_ROLLOVER_SETTING.getKey(), "min_docs=1,max_docs=1");
71+
settings.put(DataLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL, "1s");
72+
settings.put(DataLifecycle.CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING.getKey(), "min_docs=1,max_docs=1");
7373
return settings.build();
7474
}
7575

modules/dlm/src/main/java/org/elasticsearch/dlm/DataLifecyclePlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public List<Setting<?>> getSettings() {
125125
return List.of();
126126
}
127127

128-
return List.of(DataLifecycleService.DLM_POLL_INTERVAL_SETTING);
128+
return List.of(DataLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL_SETTING);
129129
}
130130

131131
@Override

modules/dlm/src/main/java/org/elasticsearch/dlm/DataLifecycleService.java

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@
6666

6767
/**
6868
* This service will implement the needed actions (e.g. rollover, retention) to manage the data streams with a DLM lifecycle configured.
69-
* It runs on the master node and it schedules a job according to the configured {@link DataLifecycleService#DLM_POLL_INTERVAL_SETTING}.
69+
* It runs on the master node and it schedules a job according to the configured
70+
* {@link DataLifecycleService#DATA_STREAM_LIFECYCLE_POLL_INTERVAL_SETTING}.
7071
*/
7172
public class DataLifecycleService implements ClusterStateListener, Closeable, SchedulerEngine.Listener {
7273

73-
public static final String DLM_POLL_INTERVAL = "indices.dlm.poll_interval";
74-
public static final Setting<TimeValue> DLM_POLL_INTERVAL_SETTING = Setting.timeSetting(
75-
DLM_POLL_INTERVAL,
74+
public static final String DATA_STREAM_LIFECYCLE_POLL_INTERVAL = "data_streams.lifecycle.poll_interval";
75+
public static final Setting<TimeValue> DATA_STREAM_LIFECYCLE_POLL_INTERVAL_SETTING = Setting.timeSetting(
76+
DATA_STREAM_LIFECYCLE_POLL_INTERVAL,
7677
TimeValue.timeValueMinutes(10),
7778
TimeValue.timeValueSeconds(1),
7879
Setting.Property.Dynamic,
@@ -83,11 +84,11 @@ public class DataLifecycleService implements ClusterStateListener, Closeable, Sc
8384
/**
8485
* Name constant for the job DLM schedules
8586
*/
86-
private static final String DATA_LIFECYCLE_JOB_NAME = "dlm";
87+
private static final String LIFECYCLE_JOB_NAME = "data_stream_lifecycle";
8788
/*
8889
* This is the key for DLM-related custom index metadata.
8990
*/
90-
static final String DLM_CUSTOM_INDEX_METADATA_KEY = "dlm";
91+
static final String LIFECYCLE_CUSTOM_INDEX_METADATA_KEY = "data_stream_lifecycle";
9192
static final String FORCE_MERGE_COMPLETED_TIMESTAMP_METADATA_KEY = "force_merge_completed_timestamp";
9293

9394
private final Settings settings;
@@ -137,8 +138,8 @@ public DataLifecycleService(
137138
this.nowSupplier = nowSupplier;
138139
this.errorStore = errorStore;
139140
this.scheduledJob = null;
140-
this.pollInterval = DLM_POLL_INTERVAL_SETTING.get(settings);
141-
this.rolloverConfiguration = clusterService.getClusterSettings().get(DataLifecycle.CLUSTER_DLM_DEFAULT_ROLLOVER_SETTING);
141+
this.pollInterval = DATA_STREAM_LIFECYCLE_POLL_INTERVAL_SETTING.get(settings);
142+
this.rolloverConfiguration = clusterService.getClusterSettings().get(DataLifecycle.CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING);
142143
this.forceMergeClusterStateUpdateTaskQueue = clusterService.createTaskQueue(
143144
"dlm-forcemerge-state-update",
144145
Priority.LOW,
@@ -151,9 +152,10 @@ public DataLifecycleService(
151152
*/
152153
public void init() {
153154
clusterService.addListener(this);
154-
clusterService.getClusterSettings().addSettingsUpdateConsumer(DLM_POLL_INTERVAL_SETTING, this::updatePollInterval);
155155
clusterService.getClusterSettings()
156-
.addSettingsUpdateConsumer(DataLifecycle.CLUSTER_DLM_DEFAULT_ROLLOVER_SETTING, this::updateRolloverConfiguration);
156+
.addSettingsUpdateConsumer(DATA_STREAM_LIFECYCLE_POLL_INTERVAL_SETTING, this::updatePollInterval);
157+
clusterService.getClusterSettings()
158+
.addSettingsUpdateConsumer(DataLifecycle.CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING, this::updateRolloverConfiguration);
157159
}
158160

159161
@Override
@@ -190,7 +192,7 @@ public void close() {
190192

191193
@Override
192194
public void triggered(SchedulerEngine.Event event) {
193-
if (event.getJobName().equals(DATA_LIFECYCLE_JOB_NAME)) {
195+
if (event.getJobName().equals(LIFECYCLE_JOB_NAME)) {
194196
if (this.isMaster) {
195197
logger.trace("DLM job triggered: {}, {}, {}", event.getJobName(), event.getScheduledTime(), event.getTriggeredTime());
196198
run(clusterService.state());
@@ -501,8 +503,9 @@ public void onFailure(Exception e) {
501503
}
502504

503505
/*
504-
* This method sets the value of the custom index metadata field "force_merge_completed_timestamp" within the field "dlm" to value. The
505-
* method returns immediately, but the update happens asynchronously and listener is notified on success or failure.
506+
* This method sets the value of the custom index metadata field "force_merge_completed_timestamp" within the field
507+
* "data_stream_lifecycle" to value. The method returns immediately, but the update happens asynchronously and listener is notified on
508+
* success or failure.
506509
*/
507510
private void setForceMergeCompletedTimestamp(String targetIndex, ActionListener<Void> listener) {
508511
forceMergeClusterStateUpdateTaskQueue.submitTask(
@@ -513,10 +516,11 @@ private void setForceMergeCompletedTimestamp(String targetIndex, ActionListener<
513516
}
514517

515518
/*
516-
* Returns true if a value has been set for the custom index metadata field "force_merge_completed_timestamp" within the field "dlm".
519+
* Returns true if a value has been set for the custom index metadata field "force_merge_completed_timestamp" within the field
520+
* "data_stream_lifecycle".
517521
*/
518522
private boolean isForceMergeComplete(IndexMetadata backingIndex) {
519-
Map<String, String> customMetadata = backingIndex.getCustomData(DLM_CUSTOM_INDEX_METADATA_KEY);
523+
Map<String, String> customMetadata = backingIndex.getCustomData(LIFECYCLE_CUSTOM_INDEX_METADATA_KEY);
520524
return customMetadata != null && customMetadata.containsKey(FORCE_MERGE_COMPLETED_TIMESTAMP_METADATA_KEY);
521525
}
522526

@@ -574,7 +578,7 @@ private void updateRolloverConfiguration(RolloverConfiguration newRolloverConfig
574578

575579
private void cancelJob() {
576580
if (scheduler.get() != null) {
577-
scheduler.get().remove(DATA_LIFECYCLE_JOB_NAME);
581+
scheduler.get().remove(LIFECYCLE_JOB_NAME);
578582
scheduledJob = null;
579583
}
580584
}
@@ -601,7 +605,7 @@ private void maybeScheduleJob() {
601605
}
602606

603607
assert scheduler.get() != null : "scheduler should be available";
604-
scheduledJob = new SchedulerEngine.Job(DATA_LIFECYCLE_JOB_NAME, new TimeValueSchedule(pollInterval));
608+
scheduledJob = new SchedulerEngine.Job(LIFECYCLE_JOB_NAME, new TimeValueSchedule(pollInterval));
605609
scheduler.get().add(scheduledJob);
606610
}
607611

@@ -628,14 +632,14 @@ static class UpdateForceMergeCompleteTask implements ClusterStateTaskListener {
628632
ClusterState execute(ClusterState currentState) throws Exception {
629633
logger.debug("Updating cluster state with force merge complete marker for {}", targetIndex);
630634
IndexMetadata indexMetadata = currentState.metadata().index(targetIndex);
631-
Map<String, String> customMetadata = indexMetadata.getCustomData(DLM_CUSTOM_INDEX_METADATA_KEY);
635+
Map<String, String> customMetadata = indexMetadata.getCustomData(LIFECYCLE_CUSTOM_INDEX_METADATA_KEY);
632636
Map<String, String> newCustomMetadata = new HashMap<>();
633637
if (customMetadata != null) {
634638
newCustomMetadata.putAll(customMetadata);
635639
}
636640
newCustomMetadata.put(FORCE_MERGE_COMPLETED_TIMESTAMP_METADATA_KEY, Long.toString(threadPool.absoluteTimeInMillis()));
637641
IndexMetadata updatededIndexMetadata = new IndexMetadata.Builder(indexMetadata).putCustom(
638-
DLM_CUSTOM_INDEX_METADATA_KEY,
642+
LIFECYCLE_CUSTOM_INDEX_METADATA_KEY,
639643
newCustomMetadata
640644
).build();
641645
Metadata metadata = Metadata.builder(currentState.metadata()).put(updatededIndexMetadata, true).build();

modules/dlm/src/main/java/org/elasticsearch/dlm/action/TransportExplainDataLifecycleAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected void masterOperation(
111111
new ExplainDataLifecycleAction.Response(
112112
explainIndices,
113113
request.includeDefaults() && DataLifecycle.isEnabled()
114-
? clusterSettings.get(DataLifecycle.CLUSTER_DLM_DEFAULT_ROLLOVER_SETTING)
114+
? clusterSettings.get(DataLifecycle.CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING)
115115
: null
116116
)
117117
);

0 commit comments

Comments
 (0)