Search in sources :

Example 1 with Predicate

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

the class DatasetConfigManagerImpl method findByDataset.

@Override
public DatasetConfigDTO findByDataset(String dataset) {
    Predicate predicate = Predicate.EQ("dataset", dataset);
    List<DatasetConfigBean> list = genericPojoDao.get(predicate, DatasetConfigBean.class);
    DatasetConfigDTO result = null;
    if (CollectionUtils.isNotEmpty(list)) {
        result = MODEL_MAPPER.map(list.get(0), DatasetConfigDTO.class);
    }
    return result;
}
Also used : DatasetConfigDTO(com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO) DatasetConfigBean(com.linkedin.thirdeye.datalayer.pojo.DatasetConfigBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 2 with Predicate

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

the class DetectionStatusManagerImpl method findLatestEntryForFunctionId.

@Override
public DetectionStatusDTO findLatestEntryForFunctionId(long functionId) {
    Predicate predicate = Predicate.EQ("functionId", functionId);
    List<DetectionStatusBean> list = genericPojoDao.get(predicate, DetectionStatusBean.class);
    DetectionStatusDTO result = null;
    if (CollectionUtils.isNotEmpty(list)) {
        Collections.sort(list);
        result = (DetectionStatusDTO) MODEL_MAPPER.map(list.get(list.size() - 1), DetectionStatusDTO.class);
    }
    return result;
}
Also used : DetectionStatusDTO(com.linkedin.thirdeye.datalayer.dto.DetectionStatusDTO) DetectionStatusBean(com.linkedin.thirdeye.datalayer.pojo.DetectionStatusBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 3 with Predicate

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

the class DetectionStatusManagerImpl method findAllInTimeRangeForFunctionAndDetectionRun.

@Override
public List<DetectionStatusDTO> findAllInTimeRangeForFunctionAndDetectionRun(long startTime, long endTime, long functionId, boolean detectionRun) {
    Predicate predicate = Predicate.AND(Predicate.EQ("functionId", functionId), Predicate.LE("dateToCheckInMS", endTime), Predicate.GE("dateToCheckInMS", startTime), Predicate.EQ("detectionRun", detectionRun));
    List<DetectionStatusBean> list = genericPojoDao.get(predicate, DetectionStatusBean.class);
    List<DetectionStatusDTO> results = new ArrayList<>();
    for (DetectionStatusBean bean : list) {
        results.add((DetectionStatusDTO) MODEL_MAPPER.map(bean, DetectionStatusDTO.class));
    }
    return results;
}
Also used : ArrayList(java.util.ArrayList) DetectionStatusDTO(com.linkedin.thirdeye.datalayer.dto.DetectionStatusDTO) DetectionStatusBean(com.linkedin.thirdeye.datalayer.pojo.DetectionStatusBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 4 with Predicate

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

the class EmailConfigurationManagerImpl method findByCollectionMetric.

@Override
public List<EmailConfigurationDTO> findByCollectionMetric(String collection, String metric) {
    Predicate predicate = Predicate.AND(Predicate.EQ("collection", collection), Predicate.EQ("metric", metric));
    List<EmailConfigurationBean> list = genericPojoDao.get(predicate, EmailConfigurationBean.class);
    List<EmailConfigurationDTO> result = new ArrayList<>();
    for (EmailConfigurationBean bean : list) {
        EmailConfigurationDTO dto = convertEmailConfigurationBean2DTO(bean);
        result.add(dto);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) EmailConfigurationBean(com.linkedin.thirdeye.datalayer.pojo.EmailConfigurationBean) EmailConfigurationDTO(com.linkedin.thirdeye.datalayer.dto.EmailConfigurationDTO) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 5 with Predicate

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

the class EventManagerImpl method findEventsBetweenTimeRange.

public List<EventDTO> findEventsBetweenTimeRange(String eventType, long start, long end) {
    Predicate predicate = Predicate.AND(Predicate.EQ("eventType", eventType), 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)

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