-
Notifications
You must be signed in to change notification settings - Fork 58
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
Provide a higher level implementation for REST handlers #246
Provide a higher level implementation for REST handlers #246
Conversation
Codecov Report
@@ Coverage Diff @@
## main #246 +/- ##
============================================
+ Coverage 67.19% 68.79% +1.60%
- Complexity 102 114 +12
============================================
Files 24 27 +3
Lines 506 532 +26
Branches 17 17
============================================
+ Hits 340 366 +26
- Misses 154 155 +1
+ Partials 12 11 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@mloufra FYI this can simplify your handlers in #213 and #221 if merged before they are. A better example of the changes you might need is in https://github.com/opensearch-project/anomaly-detection/pull/726/files However, it's a bit out of scope of what you're doing, so it's totally optional if you think it's too confusing. |
Signed-off-by: Daniel Widdis <[email protected]>
7fee000
to
833e52a
Compare
Signed-off-by: Daniel Widdis <[email protected]>
06dda4c
to
56d6347
Compare
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
src/main/java/org/opensearch/sdk/sample/helloworld/rest/RestHelloAction.java
Show resolved
Hide resolved
Thanks @dbwiddis for these information, I will take a look on that. |
I will push the code change after this PR merged |
@mloufra this one may take a while, don't hold up your PR |
got it |
Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
…project#246) * Provide a higher level implementation for REST handlers Signed-off-by: Daniel Widdis <[email protected]> * Use Function rather than Supplier for better thread safety Signed-off-by: Daniel Widdis <[email protected]> * Even shorter syntax Signed-off-by: Daniel Widdis <[email protected]> * Add tests for more BaseExtensionRestHandler coverage Signed-off-by: Daniel Widdis <[email protected]> * Make ExtensionRestHandler a Functional Interface Signed-off-by: Daniel Widdis <[email protected]> * Don't require subclasses to define route handlers. Signed-off-by: Daniel Widdis <[email protected]> Signed-off-by: Daniel Widdis <[email protected]>
Signed-off-by: Daniel Widdis [email protected]
Description
Creates a
RouteHandler
class extendingRoute
which also includes a handler methodCreates a
BaseExtensionRestHandler
abstract class:Note to reviewers: consider this comment for two possible implementations. Happy to switch back to the other one if you don't like the one I chose. The actual implementation permits either choice; the question is more about what we want the HelloWorld sample to show.
Issues Resolved
Fixes #128
Fixes #245
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.