Search in sources :

Example 6 with DataCompletenessConfigDTO

use of com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO in project pinot by linkedin.

the class DataCompletenessConfigManagerImpl method findByDatasetAndDateSDF.

@Override
public DataCompletenessConfigDTO findByDatasetAndDateSDF(String dataset, String dateToCheckInSDF) {
    Predicate predicate = Predicate.AND(Predicate.EQ("dataset", dataset), Predicate.EQ("dateToCheckInSDF", dateToCheckInSDF));
    List<DataCompletenessConfigBean> list = genericPojoDao.get(predicate, DataCompletenessConfigBean.class);
    DataCompletenessConfigDTO result = null;
    if (CollectionUtils.isNotEmpty(list)) {
        result = MODEL_MAPPER.map(list.get(0), DataCompletenessConfigDTO.class);
    }
    return result;
}
Also used : DataCompletenessConfigDTO(com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO) DataCompletenessConfigBean(com.linkedin.thirdeye.datalayer.pojo.DataCompletenessConfigBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 7 with DataCompletenessConfigDTO

use of com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO in project pinot by linkedin.

the class AbstractManagerTestBase method getTestDataCompletenessConfig.

protected DataCompletenessConfigDTO getTestDataCompletenessConfig(String dataset, long dateToCheckInMS, String dateToCheckInSDF, boolean dataComplete) {
    DataCompletenessConfigDTO dataCompletenessConfigDTO = new DataCompletenessConfigDTO();
    dataCompletenessConfigDTO.setDataset(dataset);
    dataCompletenessConfigDTO.setDateToCheckInMS(dateToCheckInMS);
    dataCompletenessConfigDTO.setDateToCheckInSDF(dateToCheckInSDF);
    dataCompletenessConfigDTO.setDataComplete(dataComplete);
    dataCompletenessConfigDTO.setCountStar(2000);
    dataCompletenessConfigDTO.setPercentComplete(79);
    dataCompletenessConfigDTO.setNumAttempts(3);
    return dataCompletenessConfigDTO;
}
Also used : DataCompletenessConfigDTO(com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO)

Example 8 with DataCompletenessConfigDTO

use of com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO in project pinot by linkedin.

the class RunAdhocDatabaseQueriesTool method enableDataCompleteness.

private void enableDataCompleteness(String dataset) {
    List<DataCompletenessConfigDTO> dtos = dataCompletenessConfigDAO.findAllByDataset(dataset);
    for (DataCompletenessConfigDTO dto : dtos) {
        dto.setDataComplete(true);
        dataCompletenessConfigDAO.update(dto);
    }
}
Also used : DataCompletenessConfigDTO(com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO)

Example 9 with DataCompletenessConfigDTO

use of com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO in project pinot by linkedin.

the class TestDataCompletenessConfigManager method testUpdate.

@Test(dependsOnMethods = { "testFind" })
public void testUpdate() {
    DataCompletenessConfigDTO dataCompletenessConfigDTO = dataCompletenessConfigDAO.findById(dataCompletenessConfigId2);
    Assert.assertNotNull(dataCompletenessConfigDTO);
    Assert.assertFalse(dataCompletenessConfigDTO.isTimedOut());
    dataCompletenessConfigDTO.setTimedOut(true);
    dataCompletenessConfigDAO.update(dataCompletenessConfigDTO);
    dataCompletenessConfigDTO = dataCompletenessConfigDAO.findById(dataCompletenessConfigId2);
    Assert.assertNotNull(dataCompletenessConfigDTO);
    Assert.assertTrue(dataCompletenessConfigDTO.isTimedOut());
}
Also used : DataCompletenessConfigDTO(com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO) Test(org.testng.annotations.Test)

Example 10 with DataCompletenessConfigDTO

use of com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO in project pinot by linkedin.

the class TestDataCompletenessConfigManager method testFind.

@Test(dependsOnMethods = { "testCreate" })
public void testFind() {
    List<DataCompletenessConfigDTO> dataCompletenessConfigDTOs = dataCompletenessConfigDAO.findAllByDataset(collection1);
    Assert.assertEquals(dataCompletenessConfigDTOs.get(0).getDataset(), collection1);
    dataCompletenessConfigDTOs = dataCompletenessConfigDAO.findAllInTimeRange(now.minusMinutes(30).getMillis(), new DateTime().getMillis());
    Assert.assertEquals(dataCompletenessConfigDTOs.size(), 1);
    dataCompletenessConfigDTOs = dataCompletenessConfigDAO.findAllByTimeOlderThan(new DateTime().getMillis());
    Assert.assertEquals(dataCompletenessConfigDTOs.size(), 2);
    dataCompletenessConfigDTOs = dataCompletenessConfigDAO.findAllByTimeOlderThanAndStatus(new DateTime().getMillis(), true);
    Assert.assertEquals(dataCompletenessConfigDTOs.size(), 1);
    DataCompletenessConfigDTO config = dataCompletenessConfigDAO.findByDatasetAndDateSDF(collection1, dateTimeFormatter.print(now.getMillis()));
    Assert.assertNotNull(config);
    Assert.assertEquals(config.getId(), dataCompletenessConfigId1);
    config = dataCompletenessConfigDAO.findByDatasetAndDateMS(collection1, now.minusHours(1).getMillis());
    Assert.assertNotNull(config);
    Assert.assertEquals(config.getId(), dataCompletenessConfigId2);
}
Also used : DataCompletenessConfigDTO(com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Aggregations

DataCompletenessConfigDTO (com.linkedin.thirdeye.datalayer.dto.DataCompletenessConfigDTO)15 DateTime (org.joda.time.DateTime)4 DataCompletenessConfigBean (com.linkedin.thirdeye.datalayer.pojo.DataCompletenessConfigBean)3 ArrayList (java.util.ArrayList)3 Test (org.testng.annotations.Test)3 Predicate (com.linkedin.thirdeye.datalayer.util.Predicate)2 HashMap (java.util.HashMap)2 DecimalFormat (java.text.DecimalFormat)1 Period (org.joda.time.Period)1