Skip to content

Commit

Permalink
[hotfix][yarn] userJarFiles can be a local variable
Browse files Browse the repository at this point in the history
This closes apache#8264.
  • Loading branch information
tisonkun authored and tillrohrmann committed Apr 26, 2019
1 parent af76026 commit ab86e26
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import static org.apache.flink.configuration.ConfigConstants.ENV_FLINK_LIB_DIR;
import static org.apache.flink.runtime.entrypoint.component.FileJobGraphRetriever.JOB_GRAPH_FILE_PATH;
Expand Down Expand Up @@ -143,10 +144,6 @@ public abstract class AbstractYarnClusterDescriptor implements ClusterDescriptor

private String applicationType;

/** Optional Jar file to include in the system class loader of all application nodes
* (for per-job submission). */
private final Set<File> userJarFiles = new HashSet<>();

private YarnConfigOptions.UserJarInclusion userJarInclusion;

public AbstractYarnClusterDescriptor(
Expand Down Expand Up @@ -739,12 +736,11 @@ public ApplicationReport startAppMaster(
1));
}

if (jobGraph != null) {
// add the user code jars from the provided JobGraph
for (org.apache.flink.core.fs.Path path : jobGraph.getUserJars()) {
userJarFiles.add(new File(path.toUri()));
}
}
final Set<File> userJarFiles = (jobGraph == null)
// not per-job submission
? Collections.emptySet()
// add user code jars from the provided JobGraph
: jobGraph.getUserJars().stream().map(f -> f.toUri()).map(File::new).collect(Collectors.toSet());

// local resource map for Yarn
final Map<String, LocalResource> localResources = new HashMap<>(2 + systemShipFiles.size() + userJarFiles.size());
Expand Down

0 comments on commit ab86e26

Please sign in to comment.