Search in sources :

Example 41 with Predicate

use of com.linkedin.thirdeye.datalayer.util.Predicate 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;
}
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)

Example 42 with Predicate

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

the class MetricConfigManagerImpl method findByDataset.

@Override
public List<MetricConfigDTO> findByDataset(String dataset) {
    Predicate predicate = Predicate.EQ("dataset", dataset);
    List<MetricConfigBean> list = genericPojoDao.get(predicate, 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)

Example 43 with Predicate

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

the class DetectionStatusManagerImpl method deleteRecordsOlderThanDays.

@Override
@Transactional
public int deleteRecordsOlderThanDays(int days) {
    DateTime expireDate = new DateTime().minusDays(days);
    Timestamp expireTimestamp = new Timestamp(expireDate.getMillis());
    Predicate timestampPredicate = Predicate.LT("createTime", expireTimestamp);
    List<DetectionStatusBean> list = genericPojoDao.get(timestampPredicate, DetectionStatusBean.class);
    for (DetectionStatusBean bean : list) {
        deleteById(bean.getId());
    }
    return list.size();
}
Also used : Timestamp(java.sql.Timestamp) DateTime(org.joda.time.DateTime) DetectionStatusBean(com.linkedin.thirdeye.datalayer.pojo.DetectionStatusBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate) Transactional(com.google.inject.persist.Transactional)

Example 44 with Predicate

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

the class EmailConfigurationManagerImpl method findByCollection.

@Override
public List<EmailConfigurationDTO> findByCollection(String collection) {
    Predicate predicate = Predicate.EQ("collection", collection);
    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 45 with Predicate

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

the class EventManagerImpl method findByEventType.

public List<EventDTO> findByEventType(String eventType) {
    Predicate predicate = Predicate.EQ("eventType", eventType);
    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