use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class MetricConfigManagerImpl method findActiveByDataset.
@Override
public List<MetricConfigDTO> findActiveByDataset(String dataset) {
Predicate datasetPredicate = Predicate.EQ("dataset", dataset);
Predicate activePredicate = Predicate.EQ("active", true);
List<MetricConfigBean> list = genericPojoDao.get(Predicate.AND(datasetPredicate, activePredicate), MetricConfigBean.class);
List<MetricConfigDTO> result = new ArrayList<>();
for (MetricConfigBean abstractBean : list) {
MetricConfigDTO dto = MODEL_MAPPER.map(abstractBean, MetricConfigDTO.class);
result.add(dto);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class MetricConfigManagerImpl method findByDataset.
@Override
public List<MetricConfigDTO> findByDataset(String dataset) {
Predicate predicate = Predicate.EQ("dataset", dataset);
List<MetricConfigBean> list = genericPojoDao.get(predicate, MetricConfigBean.class);
List<MetricConfigDTO> result = new ArrayList<>();
for (MetricConfigBean abstractBean : list) {
MetricConfigDTO dto = MODEL_MAPPER.map(abstractBean, MetricConfigDTO.class);
result.add(dto);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class DetectionStatusManagerImpl method deleteRecordsOlderThanDays.
@Override
@Transactional
public int deleteRecordsOlderThanDays(int days) {
DateTime expireDate = new DateTime().minusDays(days);
Timestamp expireTimestamp = new Timestamp(expireDate.getMillis());
Predicate timestampPredicate = Predicate.LT("createTime", expireTimestamp);
List<DetectionStatusBean> list = genericPojoDao.get(timestampPredicate, DetectionStatusBean.class);
for (DetectionStatusBean bean : list) {
deleteById(bean.getId());
}
return list.size();
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class EmailConfigurationManagerImpl method findByCollection.
@Override
public List<EmailConfigurationDTO> findByCollection(String collection) {
Predicate predicate = Predicate.EQ("collection", collection);
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 findByEventType.
public List<EventDTO> findByEventType(String eventType) {
Predicate predicate = Predicate.EQ("eventType", eventType);
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