jasonyanwenl commented on a change in pull request #5866:
URL: https://github.com/apache/incubator-pinot/pull/5866#discussion_r473202402
##########
File path:
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/api/detection/AnomalyDetectionResource.java
##########
@@ -511,24 +499,19 @@ private TaskDTO pollingTask(long taskId) {
}
private void cleanStates(MetricConfigDTO metricConfigDTO, DatasetConfigDTO
datasetConfigDTO) {
+ // Clean up ad hoc data
if (datasetConfigDTO != null) {
- datasetConfigDAO.delete(datasetConfigDTO);
- LOG.info("Deleted dataset: {}", datasetConfigDTO);
-
- int anomalyCnt = anomalyDAO.deleteByPredicate(
- Predicate.EQ("collection", datasetConfigDTO.getName()));
- LOG.info("Deleted {} anomalies with dataset {}",
- anomalyCnt, datasetConfigDTO.getName());
+ int onlineDetectionDataCnt = onlineDetectionDataDAO
+ .deleteByPredicate(Predicate.EQ("dataset",
datasetConfigDTO.getName()));
Review comment:
Thank you for the point! This is a good idea. But it also has some
trade-off. Like during the detection pipeline workflow, we cannot reuse the
existing DAO layer logic to retrieve dataset/metric configurations from
corresponding tables. Probably we will add some extra logic to separate online
detection from the original detection during the DAO layer for this. Currently
how about let's currently keep this and I will note down this in the design doc
for future reference?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]