You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/06/06 23:42:00 UTC

[GitHub] [gobblin] jhsenjaliya commented on a change in pull request #3236: [GOBBLIN-1398] load system specific hive config to support multiple h…

jhsenjaliya commented on a change in pull request #3236:
URL: https://github.com/apache/gobblin/pull/3236#discussion_r646203963



##########
File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinYarnAppLauncher.java
##########
@@ -771,20 +811,33 @@ private void addAppJars(String jarFilePathList, Optional<Map<String, LocalResour
     }
   }
 
-  private void addAppLocalFiles(String localFilePathList, Optional<Map<String, LocalResource>> resourceMap,
-      Path destDir, FileSystem localFs) throws IOException {
+  private void addAppLocalFiles(String localFilePath, String prefix, Path destDir,
+                                Optional<Map<String, LocalResource>> resourceMap, FileSystem localFs) throws IOException {
+    try {
+      if(prefix == null)  prefix = "";
 
-    for (String localFilePath : SPLITTER.split(localFilePathList)) {
       Path srcFilePath = new Path(localFilePath);
-      Path destFilePath = new Path(destDir, srcFilePath.getName());
+      Path destFilePath = new Path(destDir, prefix + srcFilePath.getName());
       if (localFs.exists(srcFilePath)) {
         this.fs.copyFromLocalFile(srcFilePath, destFilePath);
         if (resourceMap.isPresent()) {
           YarnHelixUtils.addFileAsLocalResource(this.fs, destFilePath, LocalResourceType.FILE, resourceMap.get());
+          LOGGER.debug("The request file {} added as container local file for {}", srcFilePath, prefix);
         }
       } else {
-        LOGGER.warn(String.format("The request file %s doesn't exist", srcFilePath));
+        LOGGER.warn("The request file {} doesn't exist for {}", srcFilePath, prefix);
       }
+    }catch (IOException e){
+      LOGGER.error("Error copying app local files.", e);
+      throw e;
+    }
+  }
+
+  private void addAppLocalFiles(String localFilePathList, Optional<Map<String, LocalResource>> resourceMap,

Review comment:
       just wanted to keep one for single file addition, but ya its mergeable into one. Thanks




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