Search in sources :

Example 1 with AutotuneConfigDTO

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;
}
Also used : ArrayList(java.util.ArrayList) AutotuneConfigDTO(com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO) AutotuneConfigBean(com.linkedin.thirdeye.datalayer.pojo.AutotuneConfigBean)

Example 2 with AutotuneConfigDTO

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;
}
Also used : HashMap(java.util.HashMap) AutotuneConfigDTO(com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO)

Example 3 with 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);
}
Also used : AutotuneConfigDTO(com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO) Test(org.testng.annotations.Test)

Example 4 with AutotuneConfigDTO

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);
}
Also used : AutotuneConfigDTO(com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO) Test(org.testng.annotations.Test)

Aggregations

AutotuneConfigDTO (com.linkedin.thirdeye.datalayer.dto.AutotuneConfigDTO)4 Test (org.testng.annotations.Test)2 AutotuneConfigBean (com.linkedin.thirdeye.datalayer.pojo.AutotuneConfigBean)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1