iemejia commented on a change in pull request #14520:
URL: https://github.com/apache/beam/pull/14520#discussion_r612486904



##########
File path: 
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/resources/PipelineResources.java
##########
@@ -64,6 +70,31 @@
     return resourcePath -> !resourcePath.contains("gradle/wrapper");
   }
 
+  /**
+   * Goes through the list of files that need to be staged on runner. Removes 
nonexistent
+   * directories and packages existing ones. This is necessary for runners 
that require filesToStage
+   * to be jars only.
+   *
+   * @param options options object with the files to stage and temp location 
for staging
+   */
+  public static void prepareFilesForStaging(FileStagingOptions options) {
+    List<String> filesToStage = options.getFilesToStage();
+    if (filesToStage == null || filesToStage.isEmpty()) {
+      filesToStage = 
detectClassPathResourcesToStage(ReflectHelpers.findClassLoader(), options);

Review comment:
       I am assuming that this is the 'correct' way to find the correct 
classloader, before each implementation was doing it relying on the current 
class, so there is a risk that this can be a breaking change of this PR 
(hopefully not)




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


Reply via email to