Make NamedXContent available to extensions #244
Merged
joshpalis merged 4 commits intoopensearch-project:mainfrom Nov 18, 2022
Merged
Make NamedXContent available to extensions #244joshpalis merged 4 commits intoopensearch-project:mainfrom
joshpalis merged 4 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #244 +/- ##
============================================
+ Coverage 67.19% 70.84% +3.65%
- Complexity 102 115 +13
============================================
Files 24 25 +1
Lines 506 542 +36
Branches 17 17
============================================
+ Hits 340 384 +44
+ Misses 154 146 -8
Partials 12 12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Daniel Widdis <widdis@gmail.com>
3c26ebd to
1fce412
Compare
owaiskazi19
reviewed
Nov 14, 2022
Member
|
@dbwiddis if we can add a design for getNamedXContent() in DESIGN.md would be great. |
owaiskazi19
reviewed
Nov 14, 2022
owaiskazi19
reviewed
Nov 14, 2022
src/main/java/org/opensearch/sdk/handlers/ExtensionsInitRequestHandler.java
Show resolved
Hide resolved
Member
|
#94 talks about retry for handling transport errors by doing a retry. Are we handling it in this PR? |
Member
Author
Sure, I'll provide one. It's a good template for other similar extension points. |
Member
Author
owaiskazi19
reviewed
Nov 14, 2022
owaiskazi19
previously approved these changes
Nov 15, 2022
cbf203f to
1a83f71
Compare
ryanbogan
reviewed
Nov 16, 2022
1a83f71 to
637de34
Compare
ryanbogan
previously approved these changes
Nov 16, 2022
637de34 to
8775ae8
Compare
owaiskazi19
reviewed
Nov 17, 2022
8775ae8 to
a53d20a
Compare
owaiskazi19
previously approved these changes
Nov 17, 2022
Signed-off-by: Daniel Widdis <widdis@gmail.com>
a53d20a to
9285fe1
Compare
owaiskazi19
approved these changes
Nov 18, 2022
joshpalis
approved these changes
Nov 18, 2022
kokibas
pushed a commit
to kokibas/opensearch-sdk-java
that referenced
this pull request
Mar 17, 2023
* Make NamedXContent available to extensions Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add tests Signed-off-by: Daniel Widdis <widdis@gmail.com> * No need to save custom list in registry as it's on ExtensionsRunner Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add sequence diagram to DESIGN.md Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Daniel Widdis <widdis@gmail.com>
caokyhieu
pushed a commit
to caokyhieu/opensearch-sdk-java
that referenced
this pull request
Aug 15, 2025
* Make NamedXContent available to extensions Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add tests Signed-off-by: Daniel Widdis <widdis@gmail.com> * No need to save custom list in registry as it's on ExtensionsRunner Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add sequence diagram to DESIGN.md Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Daniel Widdis <widdis@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Implements the
getNamedXContent()extension point:getNamedXContent()to theExtensioninterface, so that the ExtensionsRunner can read it. This will allow direct use of existing plugin method of this name.ExtensnionNamedXContentRegistrywhich combines the Extension's custom content and the core XContent from OpenSearch.Getters fetch either the combined registry (needed as an input for various parsers) or just the custom content (presently unused, but potentially available for transport request/response(no need, functionality already on ExtensionsRunner)ExtensionNamedXContentRegistryvia a getter to extensions so they can easily integrate them into REST Handlers by:extensionsRunnerobject from the Extension (inherited fromBaseExtension) to the RestHandlerextensionsRunner.getNamedXContentRegistry().getRegistry()to return the (combined) registry to pass to parsersSee AD #725 for an implementation leveraging these improvements!
Issues Resolved
Fixes #208
Fixes #131
Fixes #94
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.