arjun4084346 commented on a change in pull request #2981: URL: https://github.com/apache/incubator-gobblin/pull/2981#discussion_r421189567
########## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_catalog/FlowCatalog.java ########## @@ -293,30 +296,27 @@ public Spec getSpecWrapper(URI uri) { */ public Map<String, AddSpecResponse> put(Spec spec, boolean triggerListener) { Map<String, AddSpecResponse> responseMap = new HashMap<>(); + FlowSpec flowSpec = (FlowSpec) spec; Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName())); - Preconditions.checkNotNull(spec); + Preconditions.checkNotNull(flowSpec); + + log.info(String.format("Adding FlowSpec with URI: %s and Config: %s", flowSpec.getUri(), flowSpec.getConfigAsProperties())); + try { + long startTime = System.currentTimeMillis(); + specStore.addSpec(flowSpec); + metrics.updatePutSpecTime(startTime); + } catch (IOException e) { + throw new RuntimeException("Cannot add Spec to Spec store: " + flowSpec, e); + } - log.info(String.format("Adding FlowSpec with URI: %s and Config: %s", spec.getUri(), - ((FlowSpec) spec).getConfigAsProperties())); if (triggerListener) { Review comment: This if block is not throwing any exception, I do not understand why it was inside the try block earlier. ---------------------------------------------------------------- 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