-
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
[Extensions]Add query for initialized extensions #5658
[Extensions]Add query for initialized extensions #5658
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
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.
Great progress. A few more tweaks needed.
} | ||
|
||
public ExtensionRequest(StreamInput in) throws IOException { | ||
super(in); |
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 believe Requests require the super(in)
while responses do not. This should definitely match the writeTo
implementation; I don't expect it will pass tests without it matching.
this(requestType, null); | ||
} | ||
|
||
public ExtensionRequest(ExtensionsManager.RequestType requestType, Optional<String> uniqueId) { |
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.
Don't make the user provide an optional. Just take a @Nullable String
parameter here, and then set this.uniqueId
the same way you do in the stream constructor. Given the overloaded constructor above, this would set the optional to null and break things later.
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
ExtensionRequest that = (ExtensionRequest) o; | ||
return Objects.equals(requestType, that.requestType); | ||
return Objects.equals(requestType, that.requestType) && uniqueId.equals(that.uniqueId); |
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.
(Style) use the same comparison format (either Objects.equals()
or direct equals comparison) for both.
@@ -24,41 +25,53 @@ | |||
*/ | |||
public class ExtensionRequest extends TransportRequest { | |||
private static final Logger logger = LogManager.getLogger(ExtensionRequest.class); | |||
private ExtensionsManager.RequestType requestType; | |||
private final ExtensionsManager.RequestType requestType; | |||
private final Optional<String> uniqueId; |
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 looks like there is no test class for ExtensionRequest
so you should create one and include a test of this uniqueID, both in the null
case (single arg constructor) or value present case (two arg constructor)
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #5658 +/- ##
============================================
- Coverage 70.98% 70.97% -0.02%
- Complexity 58669 58685 +16
============================================
Files 4763 4765 +2
Lines 279945 280009 +64
Branches 40418 40430 +12
============================================
+ Hits 198731 198738 +7
- Misses 64988 65084 +96
+ Partials 16226 16187 -39
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/extensions/DiscoveryExtensionNode.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
@mloufra can you resolve conflicts with changelog.md? |
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
cc87d2a
to
cc1f2d9
Compare
Gradle Check (Jenkins) Run Completed with:
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-5658-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e24de72df5cc1ae7a44f84e216518b916f0c7cf5
# Push it to GitHub
git push --set-upstream origin backport/backport-5658-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
@@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
- Add support for ppc64le architecture ([#5459](https://github.com/opensearch-project/OpenSearch/pull/5459)) | |||
- Added @gbbafna as an OpenSearch maintainer ([#5668](https://github.com/opensearch-project/OpenSearch/pull/5668)) | |||
- Added support for feature flags in opensearch.yml ([#4959](https://github.com/opensearch-project/OpenSearch/pull/4959)) | |||
- Add query for initialized extensions ([#5658](https://github.com/opensearch-project/OpenSearch/pull/5658)) |
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.
@owaiskazi19 Just a heads up, but since this change was to be backported and released in 2.x, this changelog entry should have gone in the [Unreleased 2.x]
section of this file. I'm working on cleaning up the changelog on main right now.
Signed-off-by: Frank Lou [email protected]
Description
Create a feature to have an extension query to OpenSearch to obtain a list of initialized extensions and determine whether a particular extension is initialized.
Equivalent PR on OpenSearch-sdk-java : opensearch-project/opensearch-sdk-java#300
Issues Resolved
fixes opensearch-project/opensearch-sdk-java#149
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.