Skip to content

Commit

Permalink
[FLINK-12459][yarn] YarnConfigOptions#CLASSPATH_INCLUDE_USER_JAR shou…
Browse files Browse the repository at this point in the history
…ld affect the order of classpath between user jars and flink jars

Put user code jars behind the Flink distribution jar when setting
YarnConfigOptions#CLASSPATH_INCLUDE_USER_JAR to "LAST".

This closes apache#8395.
  • Loading branch information
jiasheng55 authored and tillrohrmann committed May 10, 2019
1 parent 9ffd7e7 commit c646cb2
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,6 @@ public ApplicationReport startAppMaster(
for (String classPath : systemClassPaths) {
classPathBuilder.append(classPath).append(File.pathSeparator);
}
if (userJarInclusion == YarnConfigOptions.UserJarInclusion.LAST) {
for (String userClassPath : userClassPaths) {
classPathBuilder.append(userClassPath).append(File.pathSeparator);
}
}

// Setup jar for ApplicationMaster
Path remotePathJar = setupSingleLocalResource(
Expand Down Expand Up @@ -831,6 +826,12 @@ public ApplicationReport startAppMaster(
paths.add(remotePathConf);
classPathBuilder.append("flink-conf.yaml").append(File.pathSeparator);

if (userJarInclusion == YarnConfigOptions.UserJarInclusion.LAST) {
for (String userClassPath : userClassPaths) {
classPathBuilder.append(userClassPath).append(File.pathSeparator);
}
}

// write job graph to tmp file and add it to local resource
// TODO: server use user main method to generate job graph
if (jobGraph != null) {
Expand Down

0 comments on commit c646cb2

Please sign in to comment.