use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class DataCompletenessJobRunner method createJob.
public Long createJob() {
Long jobExecutionId = null;
try {
LOG.info("Creating data completeness job");
JobDTO jobSpec = new JobDTO();
jobSpec.setJobName(dataCompletenessJobContext.getJobName());
jobSpec.setScheduleStartTime(System.currentTimeMillis());
jobSpec.setStatus(JobStatus.SCHEDULED);
jobExecutionId = DAO_REGISTRY.getJobDAO().save(jobSpec);
LOG.info("Created JobSpec {} with jobExecutionId {}", jobSpec, jobExecutionId);
} catch (Exception e) {
LOG.error("Exception in creating data completeness job", e);
}
return jobExecutionId;
}
use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class JobManagerImpl method updateStatusAndJobEndTimeForJobIds.
@Override
@Transactional
public void updateStatusAndJobEndTimeForJobIds(Set<Long> ids, JobStatus status, Long jobEndTime) {
for (Long id : ids) {
JobDTO anomalyJobSpec = findById(id);
anomalyJobSpec.setStatus(status);
anomalyJobSpec.setScheduleEndTime(jobEndTime);
update(anomalyJobSpec);
}
}
use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class JobManagerImpl method findLatestScheduledJobByName.
@Override
public JobDTO findLatestScheduledJobByName(String jobName) {
Predicate namePredicate = Predicate.EQ("name", jobName);
Predicate statusPredicate = Predicate.EQ("status", "SCHEDULED");
List<JobBean> list = genericPojoDao.get(Predicate.AND(statusPredicate, namePredicate), JobBean.class);
if (CollectionUtils.isNotEmpty(list)) {
JobDTO dto = convertBean2DTO(list.get(0), JobDTO.class);
return dto;
}
return null;
}
use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class JobManagerImpl method findNRecentJobs.
@Override
public List<JobDTO> findNRecentJobs(int n) {
String parameterizedSQL = "order by scheduleStartTime desc limit " + n;
HashMap<String, Object> parameterMap = new HashMap<>();
List<JobBean> list = genericPojoDao.executeParameterizedSQL(parameterizedSQL, parameterMap, JobBean.class);
List<JobDTO> ret = new ArrayList<>();
for (JobBean bean : list) {
JobDTO dto = convertBean2DTO(bean, JobDTO.class);
ret.add(dto);
}
return ret;
}
Aggregations