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

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

                Author: ASF GitHub Bot
            Created on: 05/Nov/19 21:51
            Start Date: 05/Nov/19 21:51
    Worklog Time Spent: 10m 
      Work Description: Will-Lo commented on pull request #2755: [GOBBLIN-897] 
adds local FS spec executor to write jobs to a local dir
URL: https://github.com/apache/incubator-gobblin/pull/2755#discussion_r342816187
 
 

 ##########
 File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_executorInstance/LocalFsSpecProducer.java
 ##########
 @@ -94,7 +96,14 @@ public LocalFsSpecProducer(Config config) {
    * @param headers*/
   @Override
   public Future<?> deleteSpec(URI deletedSpecURI, Properties headers) {
-    return new CompletedFuture<>(Boolean.TRUE, null);
+    String[] uriTokens = deletedSpecURI.getPath().split("/");
+    String jobFileName = String.join("_", uriTokens) + ".job";
+    File file = new File(jobFileName);
+    if (file.delete()) {
+      log.info("Deleted spec: {}", jobFileName);
+      return new CompletedFuture<>(Boolean.TRUE, null);
+    }
+    throw new RuntimeException(String.format("Failed to delete file with uri 
%s", deletedSpecURI));
 
 Review comment:
   That's a good point actually. In the other `SpecProducers` they throw a 
runtime exception as well, would it affect anything?
 
----------------------------------------------------------------
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: 339016)
    Time Spent: 2h 10m  (was: 2h)

> Implement Local FS Spec Executor
> --------------------------------
>
>                 Key: GOBBLIN-897
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-897
>             Project: Apache Gobblin
>          Issue Type: New Feature
>          Components: gobblin-core, gobblin-service
>    Affects Versions: 0.15.0
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>             Fix For: 0.15.0
>
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>




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

Reply via email to