Search in sources :

Example 21 with TaskDTO

use of com.linkedin.thirdeye.datalayer.dto.TaskDTO in project pinot by linkedin.

the class TaskManagerImpl method findByStatusNotIn.

@Override
@Transactional
public List<TaskDTO> findByStatusNotIn(TaskStatus status) {
    Predicate statusPredicate = Predicate.NEQ("status", status.toString());
    List<TaskBean> list = genericPojoDao.get(statusPredicate, TaskBean.class);
    List<TaskDTO> result = new ArrayList<>();
    for (TaskBean bean : list) {
        result.add((TaskDTO) MODEL_MAPPER.map(bean, TaskDTO.class));
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) TaskBean(com.linkedin.thirdeye.datalayer.pojo.TaskBean) TaskDTO(com.linkedin.thirdeye.datalayer.dto.TaskDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate) Transactional(com.google.inject.persist.Transactional)

Example 22 with TaskDTO

use of com.linkedin.thirdeye.datalayer.dto.TaskDTO in project pinot by linkedin.

the class TaskManagerImpl method updateStatusAndTaskEndTime.

@Override
public void updateStatusAndTaskEndTime(Long id, TaskStatus oldStatus, TaskStatus newStatus, Long taskEndTime) {
    TaskDTO task = findById(id);
    if (task.getStatus().equals(oldStatus)) {
        task.setStatus(newStatus);
        task.setEndTime(taskEndTime);
        save(task);
    }
}
Also used : TaskDTO(com.linkedin.thirdeye.datalayer.dto.TaskDTO)

Aggregations

TaskDTO (com.linkedin.thirdeye.datalayer.dto.TaskDTO)22 ArrayList (java.util.ArrayList)10 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)5 Test (org.testng.annotations.Test)4 TaskStatus (com.linkedin.thirdeye.anomaly.task.TaskConstants.TaskStatus)3 TaskBean (com.linkedin.thirdeye.datalayer.pojo.TaskBean)3 Predicate (com.linkedin.thirdeye.datalayer.util.Predicate)3 HashMap (java.util.HashMap)3 JobDTO (com.linkedin.thirdeye.datalayer.dto.JobDTO)2 JobExecutionException (org.quartz.JobExecutionException)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 BiMap (com.google.common.collect.BiMap)1 Transactional (com.google.inject.persist.Transactional)1 AlertTaskInfo (com.linkedin.thirdeye.anomaly.alert.AlertTaskInfo)1 TaskType (com.linkedin.thirdeye.anomaly.task.TaskConstants.TaskType)1 DataCompletenessTaskInfo (com.linkedin.thirdeye.completeness.checker.DataCompletenessTaskInfo)1 JobManager (com.linkedin.thirdeye.datalayer.bao.JobManager)1 TaskManager (com.linkedin.thirdeye.datalayer.bao.TaskManager)1 MergedAnomalyResultDTO (com.linkedin.thirdeye.datalayer.dto.MergedAnomalyResultDTO)1 RawAnomalyResultDTO (com.linkedin.thirdeye.datalayer.dto.RawAnomalyResultDTO)1