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;
}
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;
}
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);
}
}
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());
}
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);
}
Aggregations