-
Notifications
You must be signed in to change notification settings - Fork 59
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] Remove dependent code associated with the Client thread pool/context in AD for creating detector #22
Comments
Based on some lessons learned in #23 I'm going to be re-evaluating the scope of this issue when I start it next week. Essentially all dependencies on the ThreadContext need to be removed. User is done in #23 and this issue addresses Client. There is also a dependency on Settings. Settings may be included in Client and if so this issue should be sufficient. If not I'll create a new issue. |
Removing the |
I've tried a couple of experiments, and all are very invasive and require commenting out large portions of code in multiple classes, essentially making many methods no-ops or removing them entirely (and then removing all the tests dependent on them, etc.). But I think there's a simpler solution which effectively accomplishes the same thing. The problem starts here: /**
* Entry point of AD plugin.
*/
public class AnomalyDetectorPlugin extends Plugin By extending Removing the override inherits a method that creates an empty list; that essentially means there are no components (including the client) which is probably overkill. Alternately we could keep the signature as is, but pass our own client ( |
The only actual use of a specific Given that we will be implementing extensions via REST API, we should extend an existing Looking at the Extending
SO it does not look like we would need to add much to the existing try (ThreadContext.StoredContext context = client.threadPool().getThreadContext().stashContext()) {
// ... stuff possibly using context ...
} Some of them used the thread context for TLDR:
|
Completed in opensearch-project/anomaly-detection#619 |
Is your feature request related to a problem?
As we are just focusing on one user for creating a detector, the dependency of client can be removed from AD.
What solution would you like?
A clear and concise description of what you want to happen.
What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.
Do you have any additional context?
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: