[ 
https://issues.apache.org/jira/browse/GOBBLIN-1144?focusedWorklogId=431533&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-431533
 ]

ASF GitHub Bot logged work on GOBBLIN-1144:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/May/20 01:40
            Start Date: 07/May/20 01:40
    Worklog Time Spent: 10m 
      Work Description: 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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 431533)
    Time Spent: 20m  (was: 10m)

> move spec store delete to gobblinservice job scheduler
> ------------------------------------------------------
>
>                 Key: GOBBLIN-1144
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1144
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to