jack-moseley commented on a change in pull request #2921: compile a flow before 
storing it in spec catalog
URL: https://github.com/apache/incubator-gobblin/pull/2921#discussion_r391399050
 
 

 ##########
 File path: 
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigV2ResourceLocalHandler.java
 ##########
 @@ -68,19 +67,27 @@ public CreateKVResponse createFlowConfig(FlowConfig 
flowConfig, boolean triggerL
     }
 
     Map<String, AddSpecResponse> responseMap = this.flowCatalog.put(flowSpec, 
triggerListener);
-    HttpStatus httpStatus = HttpStatus.S_201_CREATED;
+    HttpStatus httpStatus;
 
     if (flowConfig.hasExplain() && flowConfig.isExplain()) {
       //This is an Explain request. So no resource is actually created.
       //Enrich original FlowConfig entity by adding the compiledFlow to the 
properties map.
       StringMap props = flowConfig.getProperties();
-      AddSpecResponse<String> addSpecResponse = 
responseMap.getOrDefault(GOBBLIN_SERVICE_JOB_SCHEDULER_LISTENER_CLASS, null);
+      AddSpecResponse<String> addSpecResponse = 
responseMap.getOrDefault(ServiceConfigKeys.GOBBLIN_SERVICE_JOB_SCHEDULER_LISTENER_CLASS,
 null);
       props.put("gobblin.flow.compiled",
           addSpecResponse != null && addSpecResponse.getValue() != null ? 
StringEscapeUtils.escapeJson(addSpecResponse.getValue()) : "");
       flowConfig.setProperties(props);
+    }
+
+    if (flowConfig.hasExplain() && flowConfig.isExplain()) {
 
 Review comment:
   I think you're ending an if block and then starting an identical one (`if 
(flowConfig.hasExplain() && flowConfig.isExplain())`) right after instead of 
just leaving it open here?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to