-
Notifications
You must be signed in to change notification settings - Fork 25.6k
DeprecationInfoAction refactoring
#121181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
elasticsearchmachine
merged 21 commits into
elastic:main
from
gmarouli:handle-9/deprecate-node-attrs-v2-follow-up
Feb 4, 2025
Merged
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
eb7b42a
Remove unnecessary bwc code from test
gmarouli 1be4642
Convert TransformDeprecationChecker from a plugin check to cluster se…
gmarouli 18fddc5
Create NodeDeprecationChecker that retrieves the node settings issues
gmarouli 2d9cb35
Remove unused LegacyIndexTemplateDeprecationChecker.java
gmarouli cd19eca
Keep one of the `filterChecks` methods
gmarouli d52eea2
Move the creation of the DeprecationInfoAction out of the data class
gmarouli d0b1f5c
Restructure the remote requests in TransportDeprecationInfoAction
gmarouli d9c304e
Rename Context to something with more "context"
gmarouli 14c1a4c
Merge with main
gmarouli 3715174
Fix format
gmarouli 82ceafc
Fix test
gmarouli c01c625
Clean up my listener mess
gmarouli bf1e2a8
Change the merged issue for node warnings, this is tested of in NodeD…
gmarouli fb3df0a
Merge branch 'main' into handle-9/deprecate-node-attrs-v2-follow-up
gmarouli 7ce49fc
merge with main
gmarouli 7bdaebb
Merge branch 'main' into handle-9/deprecate-node-attrs-v2-follow-up
gmarouli 0ffc1c7
Polishing
gmarouli 5ca2c91
Clean up
gmarouli 8f7d322
Merge branch 'main' into handle-9/deprecate-node-attrs-v2-follow-up
gmarouli 1793a4d
Merge branch 'main' into handle-9/deprecate-node-attrs-v2-follow-up
gmarouli b4ccb49
Merge branch 'main' into handle-9/deprecate-node-attrs-v2-follow-up
gmarouli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...recation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecker.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.xpack.deprecation; | ||
|
|
||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
| import org.elasticsearch.cluster.ClusterState; | ||
| import org.elasticsearch.common.TriConsumer; | ||
| import org.elasticsearch.xcontent.NamedXContentRegistry; | ||
| import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; | ||
| import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Cluster-specific deprecation checks, this is used to populate the {@code cluster_settings} field | ||
| */ | ||
| public class ClusterDeprecationChecker { | ||
|
|
||
| private static final Logger logger = LogManager.getLogger(ClusterDeprecationChecker.class); | ||
| private final List<TriConsumer<ClusterState, List<TransformConfig>, List<DeprecationIssue>>> CHECKS = List.of( | ||
| this::checkTransformSettings | ||
| ); | ||
| private final NamedXContentRegistry xContentRegistry; | ||
|
|
||
| ClusterDeprecationChecker(NamedXContentRegistry xContentRegistry) { | ||
| this.xContentRegistry = xContentRegistry; | ||
| } | ||
|
|
||
| public List<DeprecationIssue> check(ClusterState clusterState, List<TransformConfig> transformConfigs) { | ||
| List<DeprecationIssue> allIssues = new ArrayList<>(); | ||
| CHECKS.forEach(check -> check.apply(clusterState, transformConfigs, allIssues)); | ||
| return allIssues; | ||
| } | ||
|
|
||
| private void checkTransformSettings( | ||
| ClusterState clusterState, | ||
| List<TransformConfig> transformConfigs, | ||
| List<DeprecationIssue> allIssues | ||
| ) { | ||
| for (var config : transformConfigs) { | ||
| try { | ||
| allIssues.addAll(config.checkForDeprecations(xContentRegistry)); | ||
| } catch (IOException e) { | ||
| logger.warn("failed to check transformation settings for '" + config.getId() + "'", e); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 0 additions & 107 deletions
107
...ugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because the backport has been completed.