Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add async implementation of getFeaturesForPeriod. #15

Merged
merged 1 commit into from
Mar 18, 2020
Merged

Conversation

wnbts
Copy link
Contributor

@wnbts wnbts commented Dec 20, 2019

Adds the asynchronous implementation of getFeaturesForPeriod without business logic changes to deprecate the current synchronous implementation.

@wnbts wnbts marked this pull request as ready for review December 20, 2019 00:55
*/
public void getFeaturesForPeriod(AnomalyDetector detector, long startTime, long endTime, ActionListener<Optional<double[]>> listener) {
SearchRequest searchRequest = createFeatureSearchRequest(detector, startTime, endTime, Optional.empty());
client.search(searchRequest, ActionListener.wrap(
Copy link
Member

Choose a reason for hiding this comment

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

Please use ClientUtil so that we have a consistent place to control index access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the sake of transparency, what control is needed for this search query?

@wnbts wnbts closed this Jan 21, 2020
@wnbts wnbts reopened this Feb 14, 2020
* @param endTime end time of the data point in epoch milliseconds
* @param listener onResponse is called with unprocessed features and processed features for the current data point
*/
public void getCurrentFeatures(AnomalyDetector detector, long startTime, long endTime, ActionListener<SinglePointFeatures> listener) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you replace the deprecated getCurrentFeatures method with this one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rewriting caller code will be a much larger change in a separate pr.

@wnbts wnbts merged commit 56c9025 into opendistro-for-elasticsearch:development Mar 18, 2020
@wnbts wnbts deleted the fm-main branch September 11, 2020 01:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants