Search in sources :

Example 6 with NullArgumentException

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);
}
Also used : AnomalyFunctionDTO(com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO) NullArgumentException(org.apache.commons.lang.NullArgumentException)

Example 7 with NullArgumentException

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);
}
Also used : EmailConfigurationDTO(com.linkedin.thirdeye.datalayer.dto.EmailConfigurationDTO) NullArgumentException(org.apache.commons.lang.NullArgumentException)

Example 8 with NullArgumentException

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());
}
Also used : DatasetConfigDTO(com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO) NullArgumentException(org.apache.commons.lang.NullArgumentException)

Example 9 with NullArgumentException

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);
}
Also used : DatasetConfigDTO(com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO) NullArgumentException(org.apache.commons.lang.NullArgumentException)

Aggregations

NullArgumentException (org.apache.commons.lang.NullArgumentException)9 AnomalyFunctionDTO (com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO)2 DatasetConfigDTO (com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO)2 AngularObjectRegistry (org.apache.zeppelin.display.AngularObjectRegistry)2 RemoteAngularObjectRegistry (org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry)2 EmailConfigurationDTO (com.linkedin.thirdeye.datalayer.dto.EmailConfigurationDTO)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1