-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 3 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.
It does look like we set now
array
as array of arrays (singletonList(Arrays.asList(...)
), is it on purpose?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.
Hi @reta , thanks for the review! Let me explain it shortly, and I will seek for a better solution.
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 probably should update the code of parsing the API response (such as
[m, 1]
) to be a Java array, instead of modifying the unit test. I will have a try.It comes from a change in Elasticsearch 6.1, commit: elastic/elasticsearch@00dfdf5, doc: https://www.elastic.co/guide/en/elasticsearch/reference/6.1/release-notes-6.1.0.html#breaking-6.1.0
When adding the setting into yml config file:
node.attr.array: [m, 1]
There is a change of the notation of array value in the response of Nodes Info API:
In Elasticsearch 6.1 and above:
In Elasticsearch 6.0 and below:
The current Sniffer code, can only parse the old format.
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.
Oh I seem thank you for explaining @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.
I updated the API response parser to meet the array presentation in ES 6.1 for the node attributes setting.