Search in sources :

Example 1 with TaskResult

use of com.linkedin.thirdeye.anomaly.task.TaskResult in project pinot by linkedin.

the class AlertTaskRunnerV2 method execute.

@Override
public List<TaskResult> execute(TaskInfo taskInfo, TaskContext taskContext) throws Exception {
    List<TaskResult> taskResult = new ArrayList<>();
    AlertTaskInfo alertTaskInfo = (AlertTaskInfo) taskInfo;
    alertConfig = alertTaskInfo.getAlertConfigDTO();
    thirdeyeConfig = taskContext.getThirdEyeAnomalyConfiguration();
    alertFilterFactory = new AlertFilterFactory(thirdeyeConfig.getAlertFilterConfigPath());
    try {
        LOG.info("Begin executing task {}", taskInfo);
        runTask();
    } catch (Exception t) {
        LOG.error("Task failed with exception:", t);
        sendFailureEmail(t);
        // Let task driver mark this task failed
        throw t;
    }
    return taskResult;
}
Also used : AlertFilterFactory(com.linkedin.thirdeye.detector.email.filter.AlertFilterFactory) AlertTaskInfo(com.linkedin.thirdeye.anomaly.alert.AlertTaskInfo) ArrayList(java.util.ArrayList) TaskResult(com.linkedin.thirdeye.anomaly.task.TaskResult) JobExecutionException(org.quartz.JobExecutionException) EmailException(org.apache.commons.mail.EmailException)

Aggregations

AlertTaskInfo (com.linkedin.thirdeye.anomaly.alert.AlertTaskInfo)1 TaskResult (com.linkedin.thirdeye.anomaly.task.TaskResult)1 AlertFilterFactory (com.linkedin.thirdeye.detector.email.filter.AlertFilterFactory)1 ArrayList (java.util.ArrayList)1 EmailException (org.apache.commons.mail.EmailException)1 JobExecutionException (org.quartz.JobExecutionException)1