use of org.apache.commons.lang.NullArgumentException in project pinot by linkedin.
the class DetectionJobResource method toggleActive.
private void toggleActive(Long id, boolean state) {
AnomalyFunctionDTO anomalyFunctionSpec = anomalyFunctionSpecDAO.findById(id);
if (anomalyFunctionSpec == null) {
throw new NullArgumentException("Function spec not found");
}
anomalyFunctionSpec.setIsActive(state);
anomalyFunctionSpecDAO.update(anomalyFunctionSpec);
}
use of org.apache.commons.lang.NullArgumentException in project pinot by linkedin.
the class AlertJobResource method toggleActive.
private void toggleActive(Long id, boolean state) {
EmailConfigurationDTO alertConfig = emailConfigurationDAO.findById(id);
if (alertConfig == null) {
throw new NullArgumentException("Alert config not found");
}
alertConfig.setActive(state);
emailConfigurationDAO.update(alertConfig);
}
use of org.apache.commons.lang.NullArgumentException in project pinot by linkedin.
the class DetectionTaskRunner method setupTask.
private void setupTask(TaskInfo taskInfo, TaskContext taskContext) throws Exception {
DetectionTaskInfo detectionTaskInfo = (DetectionTaskInfo) taskInfo;
windowStarts = detectionTaskInfo.getWindowStartTime();
windowEnds = detectionTaskInfo.getWindowEndTime();
anomalyFunctionSpec = detectionTaskInfo.getAnomalyFunctionSpec();
jobExecutionId = detectionTaskInfo.getJobExecutionId();
anomalyFunctionFactory = taskContext.getAnomalyFunctionFactory();
anomalyFunction = anomalyFunctionFactory.fromSpec(anomalyFunctionSpec);
String dataset = anomalyFunctionSpec.getCollection();
DatasetConfigDTO datasetConfig = DAO_REGISTRY.getDatasetConfigDAO().findByDataset(dataset);
if (datasetConfig == null) {
LOG.error("Dataset [" + dataset + "] is not found");
throw new NullArgumentException("Dataset [" + dataset + "] is not found with function : " + anomalyFunctionSpec.toString());
}
collectionDimensions = datasetConfig.getDimensions();
LOG.info("Running anomaly detection job with metricFunction: [{}], topic metric [{}], collection: [{}]", anomalyFunctionSpec.getFunctionName(), anomalyFunctionSpec.getTopicMetric(), anomalyFunctionSpec.getCollection());
}
use of org.apache.commons.lang.NullArgumentException in project pinot by linkedin.
the class DatasetConfigResource method toggleRequiresCompletenessCheck.
private void toggleRequiresCompletenessCheck(String dataset, boolean state) {
DatasetConfigDTO datasetConfig = datasetConfigDao.findByDataset(dataset);
if (datasetConfig == null) {
throw new NullArgumentException("dataset config spec not found");
}
datasetConfig.setRequiresCompletenessCheck(state);
datasetConfigDao.update(datasetConfig);
}
Aggregations