You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/05/24 22:47:04 UTC

[GitHub] [incubator-pinot] xiaohui-sun commented on a change in pull request #4240: Skip pipeline validation when disabling it

xiaohui-sun commented on a change in pull request #4240: Skip pipeline validation when disabling it
URL: https://github.com/apache/incubator-pinot/pull/4240#discussion_r287533490
 
 

 ##########
 File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/YamlResource.java
 ##########
 @@ -343,14 +343,21 @@ void updateDetectionPipeline(long detectionID, String yamlDetectionConfig, long
     // Translate config from YAML to detection config (JSON)
     TreeMap<String, Object> newDetectionConfigMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
     newDetectionConfigMap.putAll(ConfigUtils.getMap(this.yaml.load(yamlDetectionConfig)));
-    detectionConfig = buildDetectionConfigFromYaml(startTime, endTime, newDetectionConfigMap, existingDetectionConfig);
-    detectionConfig.setYaml(yamlDetectionConfig);
-
-    // Validate updated config before saving it
-    detectionValidator.validateUpdatedConfig(detectionConfig, existingDetectionConfig);
-    // Save the detection config
-    Long id = this.detectionConfigDAO.save(detectionConfig);
-    Preconditions.checkNotNull(id, "Error while saving the detection pipeline");
+    // If it is to disable the pipeline then no need to do validation and parsing.
+    // It is possible that the metric or dataset was deleted so the validation will fail.
+    if (!MapUtils.getBooleanValue(newDetectionConfigMap, PROP_ACTIVE, true)) {
+      existingDetectionConfig.setActive(false);
 
 Review comment:
   Good point. I put it into "finally" now. Do you have other ideas?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org