use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class JobManagerImpl method deleteRecordsOlderThanDaysWithStatus.
@Override
@Transactional
public int deleteRecordsOlderThanDaysWithStatus(int days, JobStatus status) {
DateTime expireDate = new DateTime().minusDays(days);
Timestamp expireTimestamp = new Timestamp(expireDate.getMillis());
Predicate statusPredicate = Predicate.EQ("status", status.toString());
Predicate timestampPredicate = Predicate.LT("updateTime", expireTimestamp);
List<JobBean> list = genericPojoDao.get(Predicate.AND(statusPredicate, timestampPredicate), JobBean.class);
for (JobBean jobBean : list) {
deleteById(jobBean.getId());
}
return list.size();
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class MergedAnomalyResultManagerImpl method findByFunctionIdAndIdGreaterThan.
@Override
public List<MergedAnomalyResultDTO> findByFunctionIdAndIdGreaterThan(Long functionId, Long anomalyId) {
Predicate predicate = Predicate.AND(Predicate.EQ("functionId", functionId), Predicate.GT("baseId", anomalyId));
List<MergedAnomalyResultBean> list = genericPojoDao.get(predicate, MergedAnomalyResultBean.class);
return batchConvertMergedAnomalyBean2DTO(list, true);
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class MergedAnomalyResultManagerImpl method getAllByTimeEmailIdAndNotifiedFalse.
@Override
public List<MergedAnomalyResultDTO> getAllByTimeEmailIdAndNotifiedFalse(long startTime, long endTime, long emailConfigId) {
EmailConfigurationBean emailConfigurationBean = genericPojoDao.get(emailConfigId, EmailConfigurationBean.class);
List<Long> functionIds = emailConfigurationBean.getFunctionIds();
if (functionIds == null || functionIds.isEmpty()) {
return Collections.emptyList();
}
Long[] functionIdArray = functionIds.toArray(new Long[] {});
Predicate predicate = //
Predicate.AND(//
Predicate.LT("startTime", endTime), //
Predicate.GT("endTime", startTime), //
Predicate.IN("functionId", functionIdArray), //
Predicate.EQ("notified", false));
List<MergedAnomalyResultBean> list = genericPojoDao.get(predicate, MergedAnomalyResultBean.class);
return batchConvertMergedAnomalyBean2DTO(list, true);
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class DataCompletenessConfigManagerImpl method findAllByTimeOlderThan.
@Override
public List<DataCompletenessConfigDTO> findAllByTimeOlderThan(long time) {
Predicate predicate = Predicate.LT("dateToCheckInMS", time);
List<DataCompletenessConfigBean> list = genericPojoDao.get(predicate, DataCompletenessConfigBean.class);
return convertListOfBeanToDTO(list);
}
use of com.linkedin.thirdeye.datalayer.util.Predicate in project pinot by linkedin.
the class DataCompletenessConfigManagerImpl method findAllByDatasetAndInTimeRangeAndPercentCompleteGT.
@Override
public List<DataCompletenessConfigDTO> findAllByDatasetAndInTimeRangeAndPercentCompleteGT(String dataset, long startTime, long endTime, double percentComplete) {
Predicate timePredicate = Predicate.AND(Predicate.GE("dateToCheckInMS", startTime), Predicate.LT("dateToCheckInMS", endTime));
Predicate datasetPredicate = Predicate.EQ("dataset", dataset);
Predicate percentCompletePrediate = Predicate.GT("percentComplete", percentComplete);
List<DataCompletenessConfigBean> list = genericPojoDao.get(Predicate.AND(datasetPredicate, timePredicate, percentCompletePrediate), DataCompletenessConfigBean.class);
return convertListOfBeanToDTO(list);
}
Aggregations