use of com.linkedin.thirdeye.datalayer.dto.IngraphDashboardConfigDTO in project pinot by linkedin.
the class AbstractManagerTestBase method getTestIngraphDashboardConfig.
protected IngraphDashboardConfigDTO getTestIngraphDashboardConfig(String name) {
IngraphDashboardConfigDTO ingraphDashboardConfigDTO = new IngraphDashboardConfigDTO();
ingraphDashboardConfigDTO.setName(name);
ingraphDashboardConfigDTO.setFabricGroup("test");
ingraphDashboardConfigDTO.setFetchIntervalPeriod(3600_000);
ingraphDashboardConfigDTO.setMergeNumAvroRecords(100);
ingraphDashboardConfigDTO.setGranularitySize(5);
ingraphDashboardConfigDTO.setGranularityUnit(TimeUnit.MINUTES);
ingraphDashboardConfigDTO.setBootstrap(true);
DateTime now = new DateTime();
ingraphDashboardConfigDTO.setBootstrapStartTime(now.getMillis());
ingraphDashboardConfigDTO.setBootstrapEndTime(now.minusDays(30).getMillis());
return ingraphDashboardConfigDTO;
}
use of com.linkedin.thirdeye.datalayer.dto.IngraphDashboardConfigDTO in project pinot by linkedin.
the class TestIngraphDatasetConfigManager method testDeleteIngraphDashboard.
@Test(dependsOnMethods = { "testUpdateIngraphDashboard" })
public void testDeleteIngraphDashboard() {
ingraphDashboardConfigDAO.deleteById(ingraphDashboardConfigId1);
IngraphDashboardConfigDTO ingraphDashboardConfigDTO = ingraphDashboardConfigDAO.findById(ingraphDashboardConfigId1);
Assert.assertNull(ingraphDashboardConfigDTO);
}
use of com.linkedin.thirdeye.datalayer.dto.IngraphDashboardConfigDTO in project pinot by linkedin.
the class IngraphDashboardConfigResource method viewDashboardConfigs.
@GET
@Path("/list")
@Produces(MediaType.APPLICATION_JSON)
public String viewDashboardConfigs(@DefaultValue("0") @QueryParam("jtStartIndex") int jtStartIndex, @DefaultValue("100") @QueryParam("jtPageSize") int jtPageSize) {
List<IngraphDashboardConfigDTO> ingraphDashboardConfigDTOs = ingraphDashboardConfigDAO.findAll();
List<IngraphDashboardConfigDTO> subList = Utils.sublist(ingraphDashboardConfigDTOs, jtStartIndex, jtPageSize);
ObjectNode rootNode = JsonResponseUtil.buildResponseJSON(subList);
return rootNode.toString();
}
use of com.linkedin.thirdeye.datalayer.dto.IngraphDashboardConfigDTO in project pinot by linkedin.
the class IngraphDashboardConfigResource method createDashboardConfig.
@GET
@Path("/create")
public String createDashboardConfig(@QueryParam("name") String name, @QueryParam("fabricGroup") String fabricGroup, @QueryParam("active") boolean active, @QueryParam("bootstrap") boolean bootstrap, @QueryParam("fromIngraphDashboard") boolean fromIngraphDashboard, @QueryParam("startTime") String bootstrapStartTime, @QueryParam("endTime") String bootstrapEndTime, @QueryParam("fetchIntervalPeriod") String fetchIntervalPeriod, @QueryParam("mergeNumAvroRecords") String mergeNumAvroRecords, @QueryParam("granularitySize") String granularitySize, @QueryParam("granularityUnit") String granularityUnit) {
try {
IngraphDashboardConfigDTO ingraphDashboardConfigDTO = new IngraphDashboardConfigDTO();
ingraphDashboardConfigDTO.setName(name);
ingraphDashboardConfigDTO.setFabricGroup(fabricGroup);
if (StringUtils.isNotBlank(fetchIntervalPeriod)) {
ingraphDashboardConfigDTO.setFetchIntervalPeriod(Long.valueOf(fetchIntervalPeriod));
}
if (StringUtils.isNotBlank(mergeNumAvroRecords)) {
ingraphDashboardConfigDTO.setMergeNumAvroRecords(Integer.valueOf(mergeNumAvroRecords));
}
if (StringUtils.isNotBlank(granularitySize)) {
ingraphDashboardConfigDTO.setGranularitySize(Integer.valueOf(granularitySize));
}
if (StringUtils.isNotBlank(granularityUnit)) {
ingraphDashboardConfigDTO.setGranularityUnit(TimeUnit.valueOf(granularityUnit));
}
Boolean isActive = Boolean.valueOf(active);
ingraphDashboardConfigDTO.setActive(isActive);
Boolean isFromIngraphDashboard = Boolean.valueOf(fromIngraphDashboard);
ingraphDashboardConfigDTO.setFromIngraphDashboard(isFromIngraphDashboard);
Boolean needBootstrap = Boolean.valueOf(bootstrap);
ingraphDashboardConfigDTO.setBootstrap(needBootstrap);
if (needBootstrap) {
long startTimeInMs = sdf.parse(bootstrapStartTime).getTime();
long endTimeInMs = sdf.parse(bootstrapEndTime).getTime();
ingraphDashboardConfigDTO.setBootstrapStartTime(startTimeInMs);
ingraphDashboardConfigDTO.setBootstrapEndTime(endTimeInMs);
}
Long id = ingraphDashboardConfigDAO.save(ingraphDashboardConfigDTO);
ingraphDashboardConfigDTO.setId(id);
return JsonResponseUtil.buildResponseJSON(ingraphDashboardConfigDTO).toString();
} catch (Exception e) {
LOG.error("Failed to create dashboard:{}", name, e);
return JsonResponseUtil.buildErrorResponseJSON("Failed to create dashboard:" + name).toString();
}
}
Aggregations