use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class EventManagerImpl method findEventsBetweenTimeRangeByName.
public List<EventDTO> findEventsBetweenTimeRangeByName(String eventType, String name, long start, long end) {
Predicate predicate = Predicate.AND(Predicate.EQ("eventType", eventType), Predicate.EQ("name", name), 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;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class IngraphDashboardConfigManagerImpl method findByName.
@Override
public IngraphDashboardConfigDTO findByName(String name) {
Predicate predicate = Predicate.EQ("name", name);
List<IngraphDashboardConfigBean> list = genericPojoDao.get(predicate, IngraphDashboardConfigBean.class);
IngraphDashboardConfigDTO result = null;
if (CollectionUtils.isNotEmpty(list)) {
result = MODEL_MAPPER.map(list.get(0), IngraphDashboardConfigDTO.class);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class MetricConfigManagerImpl method findByMetricAndDataset.
@Override
public MetricConfigDTO findByMetricAndDataset(String metricName, String dataset) {
Predicate datasetPredicate = Predicate.EQ("dataset", dataset);
Predicate metricNamePredicate = Predicate.EQ("name", metricName);
List<MetricConfigBean> list = genericPojoDao.get(Predicate.AND(datasetPredicate, metricNamePredicate), MetricConfigBean.class);
MetricConfigDTO result = null;
if (CollectionUtils.isNotEmpty(list)) {
result = MODEL_MAPPER.map(list.get(0), MetricConfigDTO.class);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class MetricConfigManagerImpl method findByAliasAndDataset.
@Override
public MetricConfigDTO findByAliasAndDataset(String alias, String dataset) {
Predicate datasetPredicate = Predicate.EQ("dataset", dataset);
Predicate aliasPredicate = Predicate.EQ("alias", alias);
List<MetricConfigBean> list = genericPojoDao.get(Predicate.AND(datasetPredicate, aliasPredicate), MetricConfigBean.class);
MetricConfigDTO result = null;
if (CollectionUtils.isNotEmpty(list)) {
result = MODEL_MAPPER.map(list.get(0), MetricConfigDTO.class);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class MetricConfigManagerImpl method findByMetricName.
public List<MetricConfigDTO> findByMetricName(String metricName) {
Predicate metricNamePredicate = Predicate.EQ("name", metricName);
List<MetricConfigBean> list = genericPojoDao.get(metricNamePredicate, MetricConfigBean.class);
List<MetricConfigDTO> result = new ArrayList<>();
for (MetricConfigBean abstractBean : list) {
MetricConfigDTO dto = MODEL_MAPPER.map(abstractBean, MetricConfigDTO.class);
result.add(dto);
}
return result;
}
Aggregations