Provide a higher level implementation for REST handlers #246
Provide a higher level implementation for REST handlers #246ryanbogan merged 6 commits intoopensearch-project:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@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 <widdis@gmail.com>
7fee000 to
833e52a
Compare
Signed-off-by: Daniel Widdis <widdis@gmail.com>
06dda4c to
56d6347
Compare
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
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 <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
…project#246) * Provide a higher level implementation for REST handlers Signed-off-by: Daniel Widdis <widdis@gmail.com> * Use Function rather than Supplier for better thread safety Signed-off-by: Daniel Widdis <widdis@gmail.com> * Even shorter syntax Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add tests for more BaseExtensionRestHandler coverage Signed-off-by: Daniel Widdis <widdis@gmail.com> * Make ExtensionRestHandler a Functional Interface Signed-off-by: Daniel Widdis <widdis@gmail.com> * Don't require subclasses to define route handlers. Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Daniel Widdis <widdis@gmail.com>
…project#246) * Provide a higher level implementation for REST handlers Signed-off-by: Daniel Widdis <widdis@gmail.com> * Use Function rather than Supplier for better thread safety Signed-off-by: Daniel Widdis <widdis@gmail.com> * Even shorter syntax Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add tests for more BaseExtensionRestHandler coverage Signed-off-by: Daniel Widdis <widdis@gmail.com> * Make ExtensionRestHandler a Functional Interface Signed-off-by: Daniel Widdis <widdis@gmail.com> * Don't require subclasses to define route handlers. Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis widdis@gmail.com
Description
Creates a
RouteHandlerclass extendingRoutewhich also includes a handler methodCreates a
BaseExtensionRestHandlerabstract 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.