zxcware commented on a change in 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_r342724245
 
 

 ##########
 File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_executorInstance/LocalFsSpecProducer.java
 ##########
 @@ -71,9 +72,10 @@ public LocalFsSpecProducer(Config config) {
 
   private Future<?> writeSpec(Spec spec, SpecExecutor.Verb verb) {
     if (spec instanceof JobSpec) {
-      String specString = spec.toString();
+      URI specUri = spec.getUri();
       // format the JobSpec to have file of <flowGroup>_<flowName>.job
-      String jobFileName = specString.replace('/', 
'_').substring(specString.lastIndexOf(':')+2, specString.length()-1) + ".job";
+      String[] uriTokens = specUri.getPath().split("/");
 
 Review comment:
   We can be more DRY(Don't Repeat Yourself) by making a small function named 
`getJobFileName(uri)`

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to