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

[Feature/extensions] Remove client #619

Merged

Conversation

dbwiddis
Copy link
Member

Description

This PR removes all dependencies on the Common Utils Thread Context. It was initially used for users and roles, with most of the user code removed in #617. This cleans up the remaining (useless/unused) fetching of the thread context from the code.

The thread context was pulled from the ThreadPool, which is also no longer needed or desired in an extension and has been removed in most code.

There is still a remaining threadpool parameter in the createComponents() method which inherits/overrides Plugin and saves it as a field in the runner object, but it is okay to ignore that and not use it in later code; eventually that will no longer be needed. A thread pool is also part of the Client constructor and there is a threadpool() getter from it. While it may be harmless to keep that method around I think having it throw an exception as unused, or be deprecated, would be preferable.

Issues Resolved

Fixes opensearch-project/opensearch-sdk-java#22

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.

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, only a minor recommendation

@@ -1169,7 +1166,7 @@ private void detectAnomaly(
internalListener,
anomalyResults,
resultIndex,
() -> injectSecurity.close()
null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this parameter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my initial gut feel, as this is the only known usage of that method so it possibly could be removed ...

But the method signature is more general with a CheckedRunnable<?> runBefore to support chaining result requests. In this particular usage, we aren't chaining a request, so null terminates the (potential) sequence of Runnables. I figured it does no harm to leave it as is.

Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@saratvemulapalli saratvemulapalli changed the title Remove client [Feature/extensions] Remove client Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants