Skip to content
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

Properly initialize SDKClient actions map #520

Merged
merged 3 commits into from
Mar 3, 2023

Conversation

dbwiddis
Copy link
Member

@dbwiddis dbwiddis commented Mar 3, 2023

Description

Adds an initialize() method to the SDKClient to allow its actions map to be populated after Guice injection, even though the class was instantiated before. This is the same pattern used with NodeClient that we are emulating.

In addition, maintains a field for the Guice Injector in the ExtensionsRunner. It was getting garbage collected and losing its usefulness, particularly in Rest Handlers.

Issues Resolved

Fixes #519

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.

Signed-off-by: Daniel Widdis <widdis@gmail.com>
owaiskazi19
owaiskazi19 previously approved these changes Mar 3, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
owaiskazi19
owaiskazi19 previously approved these changes Mar 3, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #520 (d07334b) into main (85b9c6d) will increase coverage by 0.27%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main     #520      +/-   ##
============================================
+ Coverage     66.98%   67.26%   +0.27%     
- Complexity      188      191       +3     
============================================
  Files            35       35              
  Lines           833      840       +7     
  Branches         25       25              
============================================
+ Hits            558      565       +7     
  Misses          264      264              
  Partials         11       11              
Impacted Files Coverage Δ
...main/java/org/opensearch/sdk/ExtensionsRunner.java 70.85% <100.00%> (+0.50%) ⬆️
src/main/java/org/opensearch/sdk/SDKClient.java 93.02% <100.00%> (+0.34%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@owaiskazi19 owaiskazi19 merged commit da6f35f into opensearch-project:main Mar 3, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 3, 2023
* Properly initialize SDKClient actions map

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add null check and more useful exception message

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Typo

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit da6f35f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@dbwiddis dbwiddis deleted the null-actions branch March 3, 2023 22:06
dbwiddis pushed a commit that referenced this pull request Mar 3, 2023
* Properly initialize SDKClient actions map



* Add null check and more useful exception message



* Typo



---------


(cherry picked from commit da6f35f)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 17, 2023
* Properly initialize SDKClient actions map

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add null check and more useful exception message

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Typo

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 19, 2023
* Properly initialize SDKClient actions map

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add null check and more useful exception message

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Typo

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Nurym <nurym0807@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] SDKClient execute() fails with NPE
4 participants