Search in sources :

Example 6 with Predicate

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

Example 7 with Predicate

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

Example 8 with Predicate

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

Example 9 with Predicate

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

Example 10 with Predicate

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