use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class DatasetConfigManagerImpl method findByDataset.
@Override
public DatasetConfigDTO findByDataset(String dataset) {
Predicate predicate = Predicate.EQ("dataset", dataset);
List<DatasetConfigBean> list = genericPojoDao.get(predicate, DatasetConfigBean.class);
DatasetConfigDTO result = null;
if (CollectionUtils.isNotEmpty(list)) {
result = MODEL_MAPPER.map(list.get(0), DatasetConfigDTO.class);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class DetectionStatusManagerImpl method findLatestEntryForFunctionId.
@Override
public DetectionStatusDTO findLatestEntryForFunctionId(long functionId) {
Predicate predicate = Predicate.EQ("functionId", functionId);
List<DetectionStatusBean> list = genericPojoDao.get(predicate, DetectionStatusBean.class);
DetectionStatusDTO result = null;
if (CollectionUtils.isNotEmpty(list)) {
Collections.sort(list);
result = (DetectionStatusDTO) MODEL_MAPPER.map(list.get(list.size() - 1), DetectionStatusDTO.class);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class DetectionStatusManagerImpl method findAllInTimeRangeForFunctionAndDetectionRun.
@Override
public List<DetectionStatusDTO> findAllInTimeRangeForFunctionAndDetectionRun(long startTime, long endTime, long functionId, boolean detectionRun) {
Predicate predicate = Predicate.AND(Predicate.EQ("functionId", functionId), Predicate.LE("dateToCheckInMS", endTime), Predicate.GE("dateToCheckInMS", startTime), Predicate.EQ("detectionRun", detectionRun));
List<DetectionStatusBean> list = genericPojoDao.get(predicate, DetectionStatusBean.class);
List<DetectionStatusDTO> results = new ArrayList<>();
for (DetectionStatusBean bean : list) {
results.add((DetectionStatusDTO) MODEL_MAPPER.map(bean, DetectionStatusDTO.class));
}
return results;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class EmailConfigurationManagerImpl method findByCollectionMetric.
@Override
public List<EmailConfigurationDTO> findByCollectionMetric(String collection, String metric) {
Predicate predicate = Predicate.AND(Predicate.EQ("collection", collection), Predicate.EQ("metric", metric));
List<EmailConfigurationBean> list = genericPojoDao.get(predicate, EmailConfigurationBean.class);
List<EmailConfigurationDTO> result = new ArrayList<>();
for (EmailConfigurationBean bean : list) {
EmailConfigurationDTO dto = convertEmailConfigurationBean2DTO(bean);
result.add(dto);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class EventManagerImpl method findEventsBetweenTimeRange.
public List<EventDTO> findEventsBetweenTimeRange(String eventType, long start, long end) {
Predicate predicate = Predicate.AND(Predicate.EQ("eventType", eventType), Predicate.GT("endTime", start), Predicate.LT("startTime", end));
List<EventBean> list = genericPojoDao.get(predicate, EventBean.class);
List<EventDTO> results = new ArrayList<>();
for (EventBean event : list) {
EventDTO eventDTO = MODEL_MAPPER.map(event, EventDTO.class);
results.add(eventDTO);
}
return results;
}
Aggregations