From b4c28db407fc221b755ee01498f72abf8c82f17b Mon Sep 17 00:00:00 2001 From: zentol Date: Wed, 24 May 2017 15:08:57 +0200 Subject: [PATCH] [FLINK-6704][yarn] Fix user-jars not being possible to exclude from system class path --- .../apache/flink/yarn/AbstractYarnClusterDescriptor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java b/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java index 3110a5b5eb7c7f..2ec3c7baf99423 100644 --- a/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java +++ b/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java @@ -676,7 +676,13 @@ public ApplicationReport startAppMaster(JobGraph jobGraph, YarnClient yarnClient // upload and register ship files List systemClassPaths = uploadAndRegisterFiles(systemShipFiles, fs, appId.toString(), paths, localResources, envShipFileList); - List userClassPaths = uploadAndRegisterFiles(userJarFiles, fs, appId.toString(), paths, localResources, envShipFileList); + + List userClassPaths; + if (userJarInclusion != YarnConfigOptions.UserJarInclusion.DISABLED) { + userClassPaths = uploadAndRegisterFiles(userJarFiles, fs, appId.toString(), paths, localResources, envShipFileList); + } else { + userClassPaths = Collections.emptyList(); + } if (userJarInclusion == YarnConfigOptions.UserJarInclusion.ORDER) { systemClassPaths.addAll(userClassPaths);