Search in sources :

Example 1 with MonitorTaskInfo

use of com.linkedin.thirdeye.anomaly.monitor.MonitorTaskInfo in project pinot by linkedin.

the class TaskGenerator method createMonitorTasks.

public List<MonitorTaskInfo> createMonitorTasks(MonitorJobContext monitorJobContext) {
    List<MonitorTaskInfo> tasks = new ArrayList<>();
    // TODO: Currently generates 1 task for updating all the completed jobs
    // We might need to create more tasks and assign only certain number of updations to each (say 5k)
    MonitorTaskInfo updateTaskInfo = new MonitorTaskInfo();
    updateTaskInfo.setMonitorType(MonitorType.UPDATE);
    tasks.add(updateTaskInfo);
    MonitorConfiguration monitorConfiguration = monitorJobContext.getMonitorConfiguration();
    MonitorTaskInfo expireTaskInfo = new MonitorTaskInfo();
    expireTaskInfo.setMonitorType(MonitorType.EXPIRE);
    expireTaskInfo.setExpireDaysAgo(monitorConfiguration.getExpireDaysAgo());
    tasks.add(expireTaskInfo);
    return tasks;
}
Also used : MonitorTaskInfo(com.linkedin.thirdeye.anomaly.monitor.MonitorTaskInfo) MonitorConfiguration(com.linkedin.thirdeye.anomaly.monitor.MonitorConfiguration) ArrayList(java.util.ArrayList)

Aggregations

MonitorConfiguration (com.linkedin.thirdeye.anomaly.monitor.MonitorConfiguration)1 MonitorTaskInfo (com.linkedin.thirdeye.anomaly.monitor.MonitorTaskInfo)1 ArrayList (java.util.ArrayList)1