use of org.codehaus.jackson.node.ObjectNode in project pinot by linkedin.
the class DatasetConfigResource method viewDatsetConfig.
@GET
@Path("/list")
@Produces(MediaType.APPLICATION_JSON)
public String viewDatsetConfig(@DefaultValue("0") @QueryParam("jtStartIndex") int jtStartIndex, @DefaultValue("100") @QueryParam("jtPageSize") int jtPageSize) {
List<DatasetConfigDTO> datasetConfigDTOs = datasetConfigDao.findAll();
List<DatasetConfigDTO> subList = Utils.sublist(datasetConfigDTOs, jtStartIndex, jtPageSize);
ObjectNode rootNode = JsonResponseUtil.buildResponseJSON(subList);
return rootNode.toString();
}
use of org.codehaus.jackson.node.ObjectNode in project pinot by linkedin.
the class JobResource method listTasksForJob.
@GET
@Path("/listTasksForJob")
@Produces(MediaType.APPLICATION_JSON)
public String listTasksForJob(@NotNull @QueryParam("jobId") long jobId) {
Map<String, Object> filters = new HashMap<>();
filters.put("jobId", jobId);
List<TaskDTO> taskDTOs = taskDao.findByParams(filters);
ObjectNode rootNode = JsonResponseUtil.buildResponseJSON(taskDTOs);
return rootNode.toString();
}
use of org.codehaus.jackson.node.ObjectNode 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 org.codehaus.jackson.node.ObjectNode 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 org.codehaus.jackson.node.ObjectNode in project pinot by linkedin.
the class JsonResponseUtil method buildSuccessResponseJSON.
public static ObjectNode buildSuccessResponseJSON(String message) {
ObjectNode rootNode = MAPPER.getNodeFactory().objectNode();
rootNode.put("Result", "OK");
rootNode.put("Message", message);
return rootNode;
}
Aggregations