-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix the support of RestClient Node Sniffer for version 2.x and update tests #3487
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
17a603f
Fix the support of RestClient Sniffer for OpenSearch 2.0 and update t…
97d0558
Remove a tab indent
b54ea87
Fix unit test failure and remove unused codes
612d930
Parse array value of node attributes setting
7dd9ea4
Update OpenSearchNodesSnifferTests to meet the array presentation for…
c6cfb2a
add whitespace in String.split() instead of using replceAll() to remo…
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 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 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 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
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.
I certainly like this encoding approach better, but won't that be a breaking change in a sense that whoever used old notation would suddenly run into issues?
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.
The array notation for the setting value in Rest API Response has been changed since Elasticsearch 6.1, and Elasticsearch users are supposed to at least upgrade node to version 6.8 before rolling upgrade to OpenSearch (https://opensearch.org/faq#q3.3), so I don't think this code worth to be compatible with ES version <= 6.0 .
In ES version >= 6.1, the array notation in API response has been
"attributes": { "array": "[m, 1]" }
.I will ask for opinion with others as well. 😁
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.
Probably to avoid breaking change, I could add the old codes back to parse the old array notation
"attributes": { "array.0": "m", "array.1": "1" }
when backing porting this code change to 2.x branch.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.
💯% agree to that, thanks @tlfeng
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.
After getting some opinions from others, I will backport the code to
2.0
and2.x
branches, and that's fine to only support 2 previous major versions.