Skip to content

Commit 64d3f5f

Browse files
authored
Move deprecation code from xpack core to deprecation module. (#74120)
This reduces the number of imports and all deprecation code is now in one place. Also removed DeprecationChecksTests test case from x-pack core, because the same test already exists in the deprecation module.
1 parent 2d471ce commit 64d3f5f

25 files changed

+16
-94
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import org.elasticsearch.xpack.core.async.DeleteAsyncResultAction;
4141
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata;
4242
import org.elasticsearch.xpack.core.datastreams.DataStreamFeatureSetUsage;
43-
import org.elasticsearch.xpack.core.deprecation.DeprecationInfoAction;
4443
import org.elasticsearch.xpack.core.enrich.EnrichFeatureSetUsage;
4544
import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyStatus;
4645
import org.elasticsearch.xpack.core.eql.EqlFeatureSetUsage;
@@ -268,8 +267,6 @@ public List<Setting<?>> getSettings() {
268267
@Override
269268
public List<ActionType<? extends ActionResponse>> getClientActions() {
270269
List<ActionType<? extends ActionResponse>> actions = new ArrayList<>(Arrays.asList(
271-
// deprecation
272-
DeprecationInfoAction.INSTANCE,
273270
// graph
274271
GraphExploreAction.INSTANCE,
275272
// ML

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/deprecation/DeprecationChecksTests.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
import org.elasticsearch.script.ScriptService;
3030
import org.elasticsearch.threadpool.ThreadPool;
3131
import org.elasticsearch.watcher.ResourceWatcherService;
32-
import org.elasticsearch.xpack.core.deprecation.DeprecationInfoAction;
33-
import org.elasticsearch.xpack.core.deprecation.NodesDeprecationCheckAction;
3432
import org.elasticsearch.xpack.deprecation.logging.DeprecationIndexingComponent;
3533
import org.elasticsearch.xpack.deprecation.logging.DeprecationIndexingTemplateRegistry;
3634

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecker.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.elasticsearch.client.OriginSettingClient;
1313
import org.elasticsearch.common.settings.Settings;
1414
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
15-
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1615

1716
import java.util.List;
1817

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import org.elasticsearch.cluster.ClusterState;
1111
import org.elasticsearch.cluster.metadata.IndexMetadata;
1212
import org.elasticsearch.common.settings.Settings;
13-
import org.elasticsearch.xpack.core.deprecation.DeprecationInfoAction;
14-
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1513

1614
import java.util.Collections;
1715
import java.util.List;
Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,20 @@
44
* 2.0; you may not use this file except in compliance with the Elastic License
55
* 2.0.
66
*/
7-
package org.elasticsearch.xpack.core.deprecation;
7+
package org.elasticsearch.xpack.deprecation;
88

99
import org.elasticsearch.ElasticsearchStatusException;
1010
import org.elasticsearch.Version;
1111
import org.elasticsearch.action.ActionRequestValidationException;
1212
import org.elasticsearch.action.ActionResponse;
13-
import org.elasticsearch.action.IndicesRequest;
1413
import org.elasticsearch.action.ActionType;
14+
import org.elasticsearch.action.IndicesRequest;
1515
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
1616
import org.elasticsearch.action.support.IndicesOptions;
17-
import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder;
1817
import org.elasticsearch.action.support.master.MasterNodeReadRequest;
19-
import org.elasticsearch.client.ElasticsearchClient;
2018
import org.elasticsearch.cluster.ClusterState;
2119
import org.elasticsearch.cluster.metadata.IndexMetadata;
2220
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
23-
import org.elasticsearch.common.Strings;
2421
import org.elasticsearch.common.io.stream.StreamInput;
2522
import org.elasticsearch.common.io.stream.StreamOutput;
2623
import org.elasticsearch.common.util.set.Sets;
@@ -218,12 +215,8 @@ public static DeprecationInfoAction.Response from(ClusterState state,
218215

219216
public static class Request extends MasterNodeReadRequest<Request> implements IndicesRequest.Replaceable {
220217

221-
private String[] indices = Strings.EMPTY_ARRAY;
222-
private static final IndicesOptions INDICES_OPTIONS = IndicesOptions.fromOptions(false, true,
223-
true, true);
224-
225-
public Request() {
226-
}
218+
private static final IndicesOptions INDICES_OPTIONS = IndicesOptions.fromOptions(false, true, true, true);
219+
private String[] indices;
227220

228221
public Request(String... indices) {
229222
this.indices = indices;
@@ -285,16 +278,4 @@ public int hashCode() {
285278

286279
}
287280

288-
public static class RequestBuilder extends MasterNodeReadOperationRequestBuilder<Request, Response, RequestBuilder> {
289-
290-
protected RequestBuilder(ElasticsearchClient client, DeprecationInfoAction action) {
291-
super(client, action, new Request());
292-
}
293-
294-
public RequestBuilder setIndices(String... indices) {
295-
request.indices(indices);
296-
return this;
297-
}
298-
}
299-
300281
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* 2.0; you may not use this file except in compliance with the Elastic License
55
* 2.0.
66
*/
7-
package org.elasticsearch.xpack.core.deprecation;
7+
package org.elasticsearch.xpack.deprecation;
88

99

1010
import org.elasticsearch.core.Nullable;

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.elasticsearch.Version;
1111
import org.elasticsearch.cluster.metadata.IndexMetadata;
1212
import org.elasticsearch.index.IndexSettings;
13-
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1413

1514
import java.util.Locale;
1615

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/MlDeprecationChecker.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.common.xcontent.XContentElasticsearchExtension;
1515
import org.elasticsearch.xpack.core.XPackSettings;
1616
import org.elasticsearch.xpack.core.action.util.PageParams;
17-
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1817
import org.elasticsearch.xpack.core.ml.action.GetDatafeedsAction;
1918
import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction;
2019
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.elasticsearch.common.settings.Setting;
1313
import org.elasticsearch.common.settings.Settings;
1414
import org.elasticsearch.env.Environment;
15-
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1615
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
1716
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
1817

0 commit comments

Comments
 (0)