Skip to content

Commit b2cea99

Browse files
committed
remove index.lifecycle.skip setting (#34823)
With the introduction of _ilm/stop and _ilm/start APIs, the use cases where one would only target a select group of indices to start/stop has been reduced. Since there is no strong use-case for skipping specific indices, it is best to remove this functionality and only adding if later desired, with the hopes of keeping things more simple.
1 parent 675365e commit b2cea99

File tree

10 files changed

+42
-122
lines changed

10 files changed

+42
-122
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/indexlifecycle/IndexLifecycleExplainResponse.java

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public class IndexLifecycleExplainResponse implements ToXContentObject {
3939
private static final ParseField INDEX_FIELD = new ParseField("index");
4040
private static final ParseField MANAGED_BY_ILM_FIELD = new ParseField("managed");
4141
private static final ParseField POLICY_NAME_FIELD = new ParseField("policy");
42-
private static final ParseField SKIP_FIELD = new ParseField("skip");
4342
private static final ParseField LIFECYCLE_DATE_FIELD = new ParseField("lifecycle_date");
4443
private static final ParseField PHASE_FIELD = new ParseField("phase");
4544
private static final ParseField ACTION_FIELD = new ParseField("action");
@@ -57,22 +56,20 @@ public class IndexLifecycleExplainResponse implements ToXContentObject {
5756
(String) a[0],
5857
(boolean) a[1],
5958
(String) a[2],
60-
(boolean) (a[3] == null ? false: a[3]),
61-
(long) (a[4] == null ? -1L: a[4]),
59+
(long) (a[3] == null ? -1L: a[3]),
60+
(String) a[4],
6261
(String) a[5],
6362
(String) a[6],
6463
(String) a[7],
65-
(String) a[8],
64+
(long) (a[8] == null ? -1L: a[8]),
6665
(long) (a[9] == null ? -1L: a[9]),
6766
(long) (a[10] == null ? -1L: a[10]),
68-
(long) (a[11] == null ? -1L: a[11]),
69-
(BytesReference) a[12],
70-
(PhaseExecutionInfo) a[13]));
67+
(BytesReference) a[11],
68+
(PhaseExecutionInfo) a[12]));
7169
static {
7270
PARSER.declareString(ConstructingObjectParser.constructorArg(), INDEX_FIELD);
7371
PARSER.declareBoolean(ConstructingObjectParser.constructorArg(), MANAGED_BY_ILM_FIELD);
7472
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), POLICY_NAME_FIELD);
75-
PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), SKIP_FIELD);
7673
PARSER.declareLong(ConstructingObjectParser.optionalConstructorArg(), LIFECYCLE_DATE_FIELD);
7774
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), PHASE_FIELD);
7875
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), ACTION_FIELD);
@@ -100,24 +97,23 @@ public class IndexLifecycleExplainResponse implements ToXContentObject {
10097
private final long phaseTime;
10198
private final long actionTime;
10299
private final long stepTime;
103-
private final boolean skip;
104100
private final boolean managedByILM;
105101
private final BytesReference stepInfo;
106102
private final PhaseExecutionInfo phaseExecutionInfo;
107103

108-
public static IndexLifecycleExplainResponse newManagedIndexResponse(String index, String policyName, boolean skip, long lifecycleDate,
104+
public static IndexLifecycleExplainResponse newManagedIndexResponse(String index, String policyName, long lifecycleDate,
109105
String phase, String action, String step, String failedStep,
110106
long phaseTime, long actionTime, long stepTime,
111107
BytesReference stepInfo, PhaseExecutionInfo phaseExecutionInfo) {
112-
return new IndexLifecycleExplainResponse(index, true, policyName, skip, lifecycleDate, phase, action, step, failedStep, phaseTime,
108+
return new IndexLifecycleExplainResponse(index, true, policyName, lifecycleDate, phase, action, step, failedStep, phaseTime,
113109
actionTime, stepTime, stepInfo, phaseExecutionInfo);
114110
}
115111

116112
public static IndexLifecycleExplainResponse newUnmanagedIndexResponse(String index) {
117-
return new IndexLifecycleExplainResponse(index, false, null, false, -1L, null, null, null, null, -1L, -1L, -1L, null, null);
113+
return new IndexLifecycleExplainResponse(index, false, null, -1L, null, null, null, null, -1L, -1L, -1L, null, null);
118114
}
119115

120-
private IndexLifecycleExplainResponse(String index, boolean managedByILM, String policyName, boolean skip, long lifecycleDate,
116+
private IndexLifecycleExplainResponse(String index, boolean managedByILM, String policyName, long lifecycleDate,
121117
String phase, String action, String step, String failedStep, long phaseTime, long actionTime,
122118
long stepTime, BytesReference stepInfo, PhaseExecutionInfo phaseExecutionInfo) {
123119
if (managedByILM) {
@@ -134,7 +130,6 @@ private IndexLifecycleExplainResponse(String index, boolean managedByILM, String
134130
this.index = index;
135131
this.policyName = policyName;
136132
this.managedByILM = managedByILM;
137-
this.skip = skip;
138133
this.lifecycleDate = lifecycleDate;
139134
this.phase = phase;
140135
this.action = action;
@@ -159,10 +154,6 @@ public String getPolicyName() {
159154
return policyName;
160155
}
161156

162-
public boolean skip() {
163-
return skip;
164-
}
165-
166157
public long getLifecycleDate() {
167158
return lifecycleDate;
168159
}
@@ -210,7 +201,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
210201
builder.field(MANAGED_BY_ILM_FIELD.getPreferredName(), managedByILM);
211202
if (managedByILM) {
212203
builder.field(POLICY_NAME_FIELD.getPreferredName(), policyName);
213-
builder.field(SKIP_FIELD.getPreferredName(), skip);
214204
if (builder.humanReadable()) {
215205
builder.field(LIFECYCLE_DATE_FIELD.getPreferredName(), new DateTime(lifecycleDate, ISOChronology.getInstanceUTC()));
216206
} else {
@@ -250,7 +240,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
250240

251241
@Override
252242
public int hashCode() {
253-
return Objects.hash(index, managedByILM, policyName, skip, lifecycleDate, phase, action, step, failedStep, phaseTime, actionTime,
243+
return Objects.hash(index, managedByILM, policyName, lifecycleDate, phase, action, step, failedStep, phaseTime, actionTime,
254244
stepTime, stepInfo, phaseExecutionInfo);
255245
}
256246

@@ -266,7 +256,6 @@ public boolean equals(Object obj) {
266256
return Objects.equals(index, other.index) &&
267257
Objects.equals(managedByILM, other.managedByILM) &&
268258
Objects.equals(policyName, other.policyName) &&
269-
Objects.equals(skip, other.skip) &&
270259
Objects.equals(lifecycleDate, other.lifecycleDate) &&
271260
Objects.equals(phase, other.phase) &&
272261
Objects.equals(action, other.action) &&

client/rest-high-level/src/test/java/org/elasticsearch/client/indexlifecycle/IndexExplainResponseTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static IndexLifecycleExplainResponse randomUnmanagedIndexExplainResponse
5050
}
5151

5252
private static IndexLifecycleExplainResponse randomManagedIndexExplainResponse() {
53-
return IndexLifecycleExplainResponse.newManagedIndexResponse(randomAlphaOfLength(10), randomAlphaOfLength(10), randomBoolean(),
53+
return IndexLifecycleExplainResponse.newManagedIndexResponse(randomAlphaOfLength(10), randomAlphaOfLength(10),
5454
randomNonNegativeLong(), randomAlphaOfLength(10), randomAlphaOfLength(10), randomAlphaOfLength(10),
5555
randomBoolean() ? null : randomAlphaOfLength(10), randomNonNegativeLong(), randomNonNegativeLong(), randomNonNegativeLong(),
5656
randomBoolean() ? null : new BytesArray(new RandomStepInfo(() -> randomAlphaOfLength(10)).toString()),

x-pack/docs/en/ilm/apis/explain.asciidoc

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,13 @@ When the index is first taken over by ILM you will see a response like the follo
101101
"index": "my_index",
102102
"managed": true, <1>
103103
"policy": "my_policy", <2>
104-
"skip": false, <3>
105-
"lifecycle_date": 1538475653281, <4>
106-
"phase": "new", <5>
107-
"phase_time": 1538475653317, <6>
108-
"action": "complete", <7>
109-
"action_time": 1538475653317, <8>
110-
"step": "complete", <9>
111-
"step_time": 1538475653317 <10>
104+
"lifecycle_date": 1538475653281, <3>
105+
"phase": "new", <4>
106+
"phase_time": 1538475653317, <5>
107+
"action": "complete", <6>
108+
"action_time": 1538475653317, <7>
109+
"step": "complete", <8>
110+
"step_time": 1538475653317 <9>
112111
}
113112
}
114113
}
@@ -121,14 +120,13 @@ When the index is first taken over by ILM you will see a response like the follo
121120
<1> Shows if the index is being managed by ILM. If the index is not managed by
122121
ILM the other fields will not be shown
123122
<2> The name of the policy which ILM is using for this index
124-
<3> Shows whether ILM execution for the index is currently set to be skipped
125-
<4> The timestamp used for the `minimum_age`
126-
<5> The current phase
127-
<6> The timestamp for when the index entered the current phase
128-
<7> The current action
129-
<8> The timestamp for when the index entered the current action
130-
<9> The current step
131-
<10> The timestamp for when the index entered the current step
123+
<3> The timestamp used for the `minimum_age`
124+
<4> The current phase
125+
<5> The timestamp for when the index entered the current phase
126+
<6> The current action
127+
<7> The timestamp for when the index entered the current action
128+
<8> The current step
129+
<9> The timestamp for when the index entered the current step
132130

133131
When the policy is running on the index the response will contain a
134132
`phase_execution` object that describes the exact phase that is being run.
@@ -143,7 +141,6 @@ phase definition has been completely executed.
143141
"index": "test-000069",
144142
"managed": true,
145143
"policy": "my_lifecycle3",
146-
"skip": false,
147144
"lifecycle_date": "2018-10-15T13:45:21.981Z",
148145
"phase": "hot",
149146
"phase_time": "2018-10-15T13:45:22.577Z",
@@ -190,7 +187,6 @@ If the policy is waiting for a step to complete for the index, the response will
190187
"index": "test-000020",
191188
"managed": true,
192189
"policy": "my_lifecycle3",
193-
"skip": false,
194190
"lifecycle_date": "2018-10-15T13:20:28.042Z",
195191
"phase": "warm",
196192
"phase_time": "2018-10-15T13:20:28.428Z",
@@ -249,7 +245,6 @@ that occurred in `step_info`.
249245
"index": "test-000056",
250246
"managed": true,
251247
"policy": "my_lifecycle3",
252-
"skip": false,
253248
"lifecycle_date": "2018-10-15T13:38:26.209Z",
254249
"phase": "hot",
255250
"phase_time": "2018-10-15T13:38:26.706Z",

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/IndexLifecycleExplainResponse.java

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public class IndexLifecycleExplainResponse implements ToXContentObject, Writeabl
2929
private static final ParseField INDEX_FIELD = new ParseField("index");
3030
private static final ParseField MANAGED_BY_ILM_FIELD = new ParseField("managed");
3131
private static final ParseField POLICY_NAME_FIELD = new ParseField("policy");
32-
private static final ParseField SKIP_FIELD = new ParseField("skip");
3332
private static final ParseField LIFECYCLE_DATE_FIELD = new ParseField("lifecycle_date");
3433
private static final ParseField PHASE_FIELD = new ParseField("phase");
3534
private static final ParseField ACTION_FIELD = new ParseField("action");
@@ -47,22 +46,20 @@ public class IndexLifecycleExplainResponse implements ToXContentObject, Writeabl
4746
(String) a[0],
4847
(boolean) a[1],
4948
(String) a[2],
50-
(boolean) (a[3] == null ? false: a[3]),
51-
(Long) (a[4]),
49+
(Long) (a[3]),
50+
(String) a[4],
5251
(String) a[5],
5352
(String) a[6],
5453
(String) a[7],
55-
(String) a[8],
54+
(Long) (a[8]),
5655
(Long) (a[9]),
5756
(Long) (a[10]),
58-
(Long) (a[11]),
59-
(BytesReference) a[12],
60-
(PhaseExecutionInfo) a[13]));
57+
(BytesReference) a[11],
58+
(PhaseExecutionInfo) a[12]));
6159
static {
6260
PARSER.declareString(ConstructingObjectParser.constructorArg(), INDEX_FIELD);
6361
PARSER.declareBoolean(ConstructingObjectParser.constructorArg(), MANAGED_BY_ILM_FIELD);
6462
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), POLICY_NAME_FIELD);
65-
PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), SKIP_FIELD);
6663
PARSER.declareLong(ConstructingObjectParser.optionalConstructorArg(), LIFECYCLE_DATE_FIELD);
6764
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), PHASE_FIELD);
6865
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), ACTION_FIELD);
@@ -90,23 +87,22 @@ public class IndexLifecycleExplainResponse implements ToXContentObject, Writeabl
9087
private final Long phaseTime;
9188
private final Long actionTime;
9289
private final Long stepTime;
93-
private final boolean skip;
9490
private final boolean managedByILM;
9591
private final BytesReference stepInfo;
9692
private final PhaseExecutionInfo phaseExecutionInfo;
9793

98-
public static IndexLifecycleExplainResponse newManagedIndexResponse(String index, String policyName, boolean skip, Long lifecycleDate,
94+
public static IndexLifecycleExplainResponse newManagedIndexResponse(String index, String policyName, Long lifecycleDate,
9995
String phase, String action, String step, String failedStep, Long phaseTime, Long actionTime, Long stepTime,
10096
BytesReference stepInfo, PhaseExecutionInfo phaseExecutionInfo) {
101-
return new IndexLifecycleExplainResponse(index, true, policyName, skip, lifecycleDate, phase, action, step, failedStep, phaseTime,
97+
return new IndexLifecycleExplainResponse(index, true, policyName, lifecycleDate, phase, action, step, failedStep, phaseTime,
10298
actionTime, stepTime, stepInfo, phaseExecutionInfo);
10399
}
104100

105101
public static IndexLifecycleExplainResponse newUnmanagedIndexResponse(String index) {
106-
return new IndexLifecycleExplainResponse(index, false, null, false, null, null, null, null, null, null, null, null, null, null);
102+
return new IndexLifecycleExplainResponse(index, false, null, null, null, null, null, null, null, null, null, null, null);
107103
}
108104

109-
private IndexLifecycleExplainResponse(String index, boolean managedByILM, String policyName, boolean skip, Long lifecycleDate,
105+
private IndexLifecycleExplainResponse(String index, boolean managedByILM, String policyName, Long lifecycleDate,
110106
String phase, String action, String step, String failedStep, Long phaseTime, Long actionTime,
111107
Long stepTime, BytesReference stepInfo, PhaseExecutionInfo phaseExecutionInfo) {
112108
if (managedByILM) {
@@ -123,7 +119,6 @@ private IndexLifecycleExplainResponse(String index, boolean managedByILM, String
123119
this.index = index;
124120
this.policyName = policyName;
125121
this.managedByILM = managedByILM;
126-
this.skip = skip;
127122
this.lifecycleDate = lifecycleDate;
128123
this.phase = phase;
129124
this.action = action;
@@ -141,7 +136,6 @@ public IndexLifecycleExplainResponse(StreamInput in) throws IOException {
141136
managedByILM = in.readBoolean();
142137
if (managedByILM) {
143138
policyName = in.readString();
144-
skip = in.readBoolean();
145139
lifecycleDate = in.readOptionalLong();
146140
phase = in.readOptionalString();
147141
action = in.readOptionalString();
@@ -154,7 +148,6 @@ public IndexLifecycleExplainResponse(StreamInput in) throws IOException {
154148
phaseExecutionInfo = in.readOptionalWriteable(PhaseExecutionInfo::new);
155149
} else {
156150
policyName = null;
157-
skip = false;
158151
lifecycleDate = null;
159152
phase = null;
160153
action = null;
@@ -174,7 +167,6 @@ public void writeTo(StreamOutput out) throws IOException {
174167
out.writeBoolean(managedByILM);
175168
if (managedByILM) {
176169
out.writeString(policyName);
177-
out.writeBoolean(skip);
178170
out.writeOptionalLong(lifecycleDate);
179171
out.writeOptionalString(phase);
180172
out.writeOptionalString(action);
@@ -200,10 +192,6 @@ public String getPolicyName() {
200192
return policyName;
201193
}
202194

203-
public boolean skip() {
204-
return skip;
205-
}
206-
207195
public Long getLifecycleDate() {
208196
return lifecycleDate;
209197
}
@@ -251,7 +239,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
251239
builder.field(MANAGED_BY_ILM_FIELD.getPreferredName(), managedByILM);
252240
if (managedByILM) {
253241
builder.field(POLICY_NAME_FIELD.getPreferredName(), policyName);
254-
builder.field(SKIP_FIELD.getPreferredName(), skip);
255242
if (builder.humanReadable()) {
256243
builder.field(LIFECYCLE_DATE_FIELD.getPreferredName(), new DateTime(lifecycleDate, ISOChronology.getInstanceUTC()));
257244
} else {
@@ -291,7 +278,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
291278

292279
@Override
293280
public int hashCode() {
294-
return Objects.hash(index, managedByILM, policyName, skip, lifecycleDate, phase, action, step, failedStep, phaseTime, actionTime,
281+
return Objects.hash(index, managedByILM, policyName, lifecycleDate, phase, action, step, failedStep, phaseTime, actionTime,
295282
stepTime, stepInfo, phaseExecutionInfo);
296283
}
297284

@@ -307,7 +294,6 @@ public boolean equals(Object obj) {
307294
return Objects.equals(index, other.index) &&
308295
Objects.equals(managedByILM, other.managedByILM) &&
309296
Objects.equals(policyName, other.policyName) &&
310-
Objects.equals(skip, other.skip) &&
311297
Objects.equals(lifecycleDate, other.lifecycleDate) &&
312298
Objects.equals(phase, other.phase) &&
313299
Objects.equals(action, other.action) &&

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/LifecycleSettings.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
public class LifecycleSettings {
1515
public static final String LIFECYCLE_POLL_INTERVAL = "indices.lifecycle.poll_interval";
1616
public static final String LIFECYCLE_NAME = "index.lifecycle.name";
17-
public static final String LIFECYCLE_SKIP = "index.lifecycle.skip";
1817

1918
public static final Setting<TimeValue> LIFECYCLE_POLL_INTERVAL_SETTING = Setting.positiveTimeSetting(LIFECYCLE_POLL_INTERVAL,
2019
TimeValue.timeValueMinutes(10), Setting.Property.Dynamic, Setting.Property.NodeScope);
2120
public static final Setting<String> LIFECYCLE_NAME_SETTING = Setting.simpleString(LIFECYCLE_NAME,
2221
Setting.Property.Dynamic, Setting.Property.IndexScope);
23-
public static final Setting<Boolean> LIFECYCLE_SKIP_SETTING = Setting.boolSetting(LIFECYCLE_SKIP, false,
24-
Setting.Property.Dynamic, Setting.Property.IndexScope);
2522
}

0 commit comments

Comments
 (0)