use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class JobResource method listJobsForDataset.
@GET
@Path("/listJobsForDataset")
@Produces(MediaType.APPLICATION_JSON)
public String listJobsForDataset(@NotNull @QueryParam("dataset") String dataset, @DefaultValue("0") @QueryParam("jtStartIndex") int jtStartIndex, @DefaultValue("10") @QueryParam("jtPageSize") int jtPageSize) {
// Map<String, Object> filters = new HashMap<>();
// filters.put("dataset", dataset);
// List<JobDTO> jobDTOs = jobDao.findByParams(filters);
//TODO: we don't have enough info to find jobs for a dataset, may be we should change this to functions?
List<JobDTO> jobDTOs = Collections.emptyList();
ObjectNode rootNode = JsonResponseUtil.buildResponseJSON(jobDTOs);
return rootNode.toString();
}
use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class JobResource method listRecentJobs.
@GET
@Path("/listRecentJobs")
@Produces(MediaType.APPLICATION_JSON)
public String listRecentJobs(@DefaultValue("0") @QueryParam("jtStartIndex") int jtStartIndex, @DefaultValue("10") @QueryParam("jtPageSize") int jtPageSize) {
List<JobDTO> jobDTOs = jobDao.findNRecentJobs(jtStartIndex + jtPageSize);
List<JobDTO> subList = Utils.sublist(jobDTOs, jtStartIndex, jtPageSize);
ObjectNode rootNode = JsonResponseUtil.buildResponseJSON(subList);
return rootNode.toString();
}
use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class TestAnomalyJobManager method testFindByStatus.
@Test(dependsOnMethods = { "testUpdateStatusAndJobEndTime" })
public void testFindByStatus() {
JobStatus status = JobStatus.COMPLETED;
List<JobDTO> anomalyJobs = jobDAO.findByStatus(status);
Assert.assertEquals(anomalyJobs.size(), 2);
Assert.assertEquals(anomalyJobs.get(0).getStatus(), status);
}
use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class TestAnomalyJobManager method testDeleteRecordsOlderThanDaysWithStatus.
@Test(dependsOnMethods = { "testFindByStatus" })
public void testDeleteRecordsOlderThanDaysWithStatus() {
JobStatus status = JobStatus.COMPLETED;
int numRecordsDeleted = jobDAO.deleteRecordsOlderThanDaysWithStatus(0, status);
Assert.assertEquals(numRecordsDeleted, 2);
List<JobDTO> anomalyJobs = jobDAO.findByStatus(status);
Assert.assertEquals(anomalyJobs.size(), 0);
}
use of com.linkedin.thirdeye.datalayer.dto.JobDTO in project pinot by linkedin.
the class TestAnomalyJobManager method printAll.
private void printAll(String msg) {
List<JobDTO> allAnomalyJobs = jobDAO.findAll();
System.out.println("START:ALL JOB after:" + msg);
for (JobDTO jobDTO : allAnomalyJobs) {
System.out.println(jobDTO);
}
System.out.println("END:ALL JOB after:" + msg);
}
Aggregations