Search in sources :

Example 21 with Predicate

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

the class DataCompletenessConfigManagerImpl method findAllByTimeOlderThanAndStatus.

@Override
public List<DataCompletenessConfigDTO> findAllByTimeOlderThanAndStatus(long time, boolean dataComplete) {
    Predicate datePredicate = Predicate.LT("dateToCheckInMS", time);
    Predicate dataCompletePredicate = Predicate.EQ("dataComplete", dataComplete);
    List<DataCompletenessConfigBean> list = genericPojoDao.get(Predicate.AND(datePredicate, dataCompletePredicate), DataCompletenessConfigBean.class);
    return convertListOfBeanToDTO(list);
}
Also used : DataCompletenessConfigBean(com.linkedin.thirdeye.datalayer.pojo.DataCompletenessConfigBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 22 with Predicate

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

the class DataCompletenessConfigManagerImpl method findAllByDataset.

@Override
public List<DataCompletenessConfigDTO> findAllByDataset(String dataset) {
    Predicate predicate = Predicate.EQ("dataset", dataset);
    List<DataCompletenessConfigBean> list = genericPojoDao.get(predicate, DataCompletenessConfigBean.class);
    return convertListOfBeanToDTO(list);
}
Also used : DataCompletenessConfigBean(com.linkedin.thirdeye.datalayer.pojo.DataCompletenessConfigBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 23 with Predicate

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

the class DataCompletenessConfigManagerImpl method findByDatasetAndDateSDF.

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

Example 24 with Predicate

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

the class DatasetConfigManagerImpl method findActiveRequiresCompletenessCheck.

@Override
public List<DatasetConfigDTO> findActiveRequiresCompletenessCheck() {
    Predicate activePredicate = Predicate.EQ("active", true);
    Predicate completenessPredicate = Predicate.EQ("requiresCompletenessCheck", true);
    List<DatasetConfigBean> list = genericPojoDao.get(Predicate.AND(activePredicate, completenessPredicate), DatasetConfigBean.class);
    List<DatasetConfigDTO> results = new ArrayList<>();
    for (DatasetConfigBean abstractBean : list) {
        DatasetConfigDTO result = MODEL_MAPPER.map(abstractBean, DatasetConfigDTO.class);
        results.add(result);
    }
    return results;
}
Also used : DatasetConfigDTO(com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO) ArrayList(java.util.ArrayList) DatasetConfigBean(com.linkedin.thirdeye.datalayer.pojo.DatasetConfigBean) Predicate(com.linkedin.thirdeye.datalayer.util.Predicate)

Example 25 with Predicate

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

the class AnomalyFunctionManagerImpl method findAllActiveFunctions.

/*
   * (non-Javadoc)
   *
   * @see com.linkedin.thirdeye.datalayer.bao.IAnomalyFunctionManager# findAllActiveFunctions()
   */
@Override
public List<AnomalyFunctionDTO> findAllActiveFunctions() {
    Predicate predicate = Predicate.EQ("active", true);
    List<AnomalyFunctionBean> list = genericPojoDao.get(predicate, AnomalyFunctionBean.class);
    List<AnomalyFunctionDTO> result = new ArrayList<>();
    for (AnomalyFunctionBean abstractBean : list) {
        AnomalyFunctionDTO dto = MODEL_MAPPER.map(abstractBean, AnomalyFunctionDTO.class);
        result.add(dto);
    }
    return result;
}
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)

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