use of com.linkedin.thirdeye.datalayer.pojo.MetricConfigBean 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.pojo.MetricConfigBean 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.pojo.MetricConfigBean 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;
}
use of com.linkedin.thirdeye.datalayer.pojo.MetricConfigBean in project pinot by linkedin.
the class MetricConfigManagerImpl method findWhereNameLike.
@Override
public List<MetricConfigDTO> findWhereNameLike(String name) {
Map<String, Object> parameterMap = new HashMap<>();
parameterMap.put("name", name);
List<MetricConfigBean> list = genericPojoDao.executeParameterizedSQL(FIND_BY_NAME_LIKE, parameterMap, MetricConfigBean.class);
List<MetricConfigDTO> result = new ArrayList<>();
for (MetricConfigBean bean : list) {
result.add(MODEL_MAPPER.map(bean, MetricConfigDTO.class));
}
return result;
}
use of com.linkedin.thirdeye.datalayer.pojo.MetricConfigBean 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;
}
Aggregations