use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class AnomalyFunctionManagerImpl method findAllByCollection.
@Override
public List<AnomalyFunctionDTO> findAllByCollection(String collection) {
Predicate predicate = Predicate.EQ("collection", collection);
List<AnomalyFunctionBean> list = genericPojoDao.get(predicate, AnomalyFunctionBean.class);
List<AnomalyFunctionDTO> result = new ArrayList<>();
for (AnomalyFunctionBean abstractBean : list) {
AnomalyFunctionDTO dto = MODEL_MAPPER.map(abstractBean, AnomalyFunctionDTO.class);
result.add(dto);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class AnomalyFunctionManagerImpl method findDistinctTopicMetricsByCollection.
@Override
public List<String> findDistinctTopicMetricsByCollection(String collection) {
Predicate predicate = Predicate.EQ("collection", collection);
List<AnomalyFunctionBean> list = genericPojoDao.get(predicate, AnomalyFunctionBean.class);
Set<String> metrics = new HashSet<>();
for (AnomalyFunctionBean anomalyFunctionBean : list) {
AnomalyFunctionDTO dto = MODEL_MAPPER.map(anomalyFunctionBean, AnomalyFunctionDTO.class);
metrics.add(dto.getTopicMetric());
}
return new ArrayList<>(metrics);
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class AutotuneConfigManagerImpl method findAllByFunctionIdAutotuneAndEvaluationMethod.
@Override
public List<AutotuneConfigDTO> findAllByFunctionIdAutotuneAndEvaluationMethod(long functionId, String autoTuneMethod, String performanceEvaluationMethod) {
Predicate predicate = Predicate.AND(Predicate.EQ(FUNCTION_ID, functionId), Predicate.EQ(AUTOTUNE_METHOD, autoTuneMethod), Predicate.EQ(PERFORMANCE_EVALUATION_METHOD, performanceEvaluationMethod));
List<AutotuneConfigBean> list = genericPojoDao.get(predicate, AutotuneConfigBean.class);
return beansToDTOs(list);
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class IngraphMetricConfigManagerImpl method findByDashboardAndMetricName.
@Override
public IngraphMetricConfigDTO findByDashboardAndMetricName(String dashboardName, String metricName) {
Predicate dashboardPredicate = Predicate.EQ("dashboardName", dashboardName);
Predicate metricPredicate = Predicate.EQ("metricName", metricName);
List<IngraphMetricConfigBean> list = genericPojoDao.get(Predicate.AND(dashboardPredicate, metricPredicate), IngraphMetricConfigBean.class);
IngraphMetricConfigDTO result = null;
if (CollectionUtils.isNotEmpty(list)) {
result = MODEL_MAPPER.map(list.get(0), IngraphMetricConfigDTO.class);
}
return result;
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class IngraphMetricConfigManagerImpl method findByRrdName.
@Override
public IngraphMetricConfigDTO findByRrdName(String rrdName) {
Predicate dashboardPredicate = Predicate.EQ("rrdName", rrdName);
List<IngraphMetricConfigBean> list = genericPojoDao.get(dashboardPredicate, IngraphMetricConfigBean.class);
IngraphMetricConfigDTO result = null;
if (CollectionUtils.isNotEmpty(list)) {
result = MODEL_MAPPER.map(list.get(0), IngraphMetricConfigDTO.class);
}
return result;
}
Aggregations