use of com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO in project pinot by linkedin.
the class AutotuneConfigManagerImpl method beansToDTOs.
private List<AutotuneConfigDTO> beansToDTOs(List<AutotuneConfigBean> list) {
List<AutotuneConfigDTO> result = new ArrayList<>();
for (AutotuneConfigBean bean : list) {
AutotuneConfigDTO dto = MODEL_MAPPER.map(bean, AutotuneConfigDTO.class);
result.add(dto);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO in project pinot by linkedin.
the class AbstractManagerTestBase method getTestAutotuneConfig.
protected AutotuneConfigDTO getTestAutotuneConfig(long functionId, long start, long end) {
AutotuneConfigDTO autotuneConfigDTO = new AutotuneConfigDTO();
autotuneConfigDTO.setFunctionId(functionId);
autotuneConfigDTO.setStartTime(start);
autotuneConfigDTO.setEndTime(end);
autotuneConfigDTO.setPerformanceEvaluationMethod(PerformanceEvaluationMethod.ANOMALY_PERCENTAGE);
autotuneConfigDTO.setLastUpdateTimestamp(DateTime.now().getMillis());
Map<String, String> config = new HashMap<>();
config.put("ConfigKey", "ConfigValue");
autotuneConfigDTO.setConfiguration(config);
Map<String, Double> performance = new HashMap<>();
performance.put(autotuneConfigDTO.getPerformanceEvaluationMethod().name(), 0.5);
autotuneConfigDTO.setPerformance(performance);
return autotuneConfigDTO;
}
use of com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO in project pinot by linkedin.
the class TestAutotuneConfigManager method testDelete.
@Test(dependsOnMethods = { "testUpdate" })
public void testDelete() {
autotuneConfigDAO.deleteById(autotuneId);
AutotuneConfigDTO spec = autotuneConfigDAO.findById(autotuneId);
Assert.assertNull(spec);
}
use of com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO in project pinot by linkedin.
the class TestAutotuneConfigManager method testUpdate.
@Test(dependsOnMethods = { "testFindAllByFunctionId" })
public void testUpdate() {
AutotuneConfigDTO spec = autotuneConfigDAO.findById(autotuneId);
Assert.assertNotNull(spec);
spec.setAutotuneMethod(AutotuneMethodType.EXHAUSTIVE);
autotuneConfigDAO.save(spec);
AutotuneConfigDTO specReturned = autotuneConfigDAO.findById(autotuneId);
Assert.assertEquals(specReturned.getAutotuneMethod(), AutotuneMethodType.EXHAUSTIVE);
}
Aggregations