-
Notifications
You must be signed in to change notification settings - Fork 0
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
update/delete historical detector;search AD tasks #1
Conversation
...com/amazon/opendistroforelasticsearch/ad/rest/handler/IndexAnomalyDetectorActionHandler.java
Outdated
Show resolved
Hide resolved
if (existingDetector.isRealTimeDetector()) { | ||
validateDetector(existingDetector); | ||
} else { | ||
validateCategoricalField(detectorId); | ||
adTaskManager.getLatestADTask(detectorId, (adTask) -> { | ||
if (adTask.isPresent() && !adTaskManager.isADTaskEnded(adTask.get())) { | ||
// can't update detector if there is AD task running | ||
listener.onFailure(new ElasticsearchStatusException("Detector is running", RestStatus.INTERNAL_SERVER_ERROR)); | ||
} else { | ||
// TODO: change to validateDetector method when we support HC historical detector | ||
searchAdInputIndices(detectorId); | ||
} | ||
}, transportService, listener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the TODO for the change of validateDetector. Can it be done in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validateDetector
is only for HC detector. It will not validate single entity detector. We only support single entity historical detector currently.
Will change this method name to make it clear.
|
||
import com.amazon.opendistroforelasticsearch.ad.constant.CommonValue; | ||
|
||
public class SearchADTasksAction extends ActionType<SearchResponse> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case to call this api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For current phase, this is only used for Ops purpose. User can use this to search historical tasks as we don't show task level data on Kibana.
From UX, we may develop task management page on Kibana in future, then we can use this API to search tasks and show them on Kibana.
Codecov Report
@@ Coverage Diff @@
## pr_stop_task #1 +/- ##
===============================================
Coverage 77.29% 77.29%
Complexity 2279 2279
===============================================
Files 214 214
Lines 10242 10242
Branches 909 909
===============================================
Hits 7917 7917
Misses 1906 1906
Partials 419 419
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…pendistro-for-elasticsearch#359) * stop historical detector; support return AD task in get detector API * change to scaling executor * remove detector cache; handle node crash * add more comments/logs; tune method name
Close this PR as we have released historical detector. |
This PR is to gather feedback earlier, as this PR depends on some changes of PR opendistro-for-elasticsearch#359, can't send out PR based on master branch. Will send out another to merge into master branch later.
Description of changes:
Test
./gradlew build
./gradlew integTest -PnumNodes=3