Search in sources :

Example 31 with Predicate

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);
}
Also used : AnomalyFunctionBean(com.linkedin.thirdeye.datalayer.pojo.AnomalyFunctionBean) ArrayList(java.util.ArrayList) AnomalyFunctionDTO(com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate) HashSet(java.util.HashSet)

Example 32 with Predicate

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);
}
Also used : AutotuneConfigBean(com.linkedin.thirdeye.datalayer.pojo.AutotuneConfigBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 33 with Predicate

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;
}
Also used : IngraphMetricConfigBean(com.linkedin.thirdeye.datalayer.pojo.IngraphMetricConfigBean) IngraphMetricConfigDTO(com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 34 with Predicate

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;
}
Also used : IngraphMetricConfigBean(com.linkedin.thirdeye.datalayer.pojo.IngraphMetricConfigBean) IngraphMetricConfigDTO(com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 35 with Predicate

use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.

the class JobManagerImpl method findLatestScheduledJobByName.

@Override
public JobDTO findLatestScheduledJobByName(String jobName) {
    Predicate namePredicate = Predicate.EQ("name", jobName);
    Predicate statusPredicate = Predicate.EQ("status", "SCHEDULED");
    List<JobBean> list = genericPojoDao.get(Predicate.AND(statusPredicate, namePredicate), JobBean.class);
    if (CollectionUtils.isNotEmpty(list)) {
        JobDTO dto = convertBean2DTO(list.get(0), JobDTO.class);
        return dto;
    }
    return null;
}
Also used : JobDTO(com.linkedin.thirdeye.datalayer.dto.JobDTO) JobBean(com.linkedin.thirdeye.datalayer.pojo.JobBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Aggregations

Predicate (com.linkedin.thirdeye.datalayer.util.Predicate)53 ArrayList (java.util.ArrayList)19 DataCompletenessConfigBean (com.linkedin.thirdeye.datalayer.pojo.DataCompletenessConfigBean)9 MergedAnomalyResultBean (com.linkedin.thirdeye.datalayer.pojo.MergedAnomalyResultBean)7 MetricConfigDTO (com.linkedin.thirdeye.datalayer.dto.MetricConfigDTO)5 MetricConfigBean (com.linkedin.thirdeye.datalayer.pojo.MetricConfigBean)5 Transactional (com.google.inject.persist.Transactional)4 AutotuneConfigBean (com.linkedin.thirdeye.datalayer.pojo.AutotuneConfigBean)4 AnomalyFunctionDTO (com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO)3 DashboardConfigDTO (com.linkedin.thirdeye.datalayer.dto.DashboardConfigDTO)3 DatasetConfigDTO (com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO)3 EventDTO (com.linkedin.thirdeye.datalayer.dto.EventDTO)3 IngraphMetricConfigDTO (com.linkedin.thirdeye.datalayer.dto.IngraphMetricConfigDTO)3 TaskDTO (com.linkedin.thirdeye.datalayer.dto.TaskDTO)3 AnomalyFunctionBean (com.linkedin.thirdeye.datalayer.pojo.AnomalyFunctionBean)3 DashboardConfigBean (com.linkedin.thirdeye.datalayer.pojo.DashboardConfigBean)3 DatasetConfigBean (com.linkedin.thirdeye.datalayer.pojo.DatasetConfigBean)3 DetectionStatusBean (com.linkedin.thirdeye.datalayer.pojo.DetectionStatusBean)3 EmailConfigurationBean (com.linkedin.thirdeye.datalayer.pojo.EmailConfigurationBean)3 EventBean (com.linkedin.thirdeye.datalayer.pojo.EventBean)3