3838import org .slf4j .LoggerFactory ;
3939
4040import java .io .File ;
41+ import java .io .UnsupportedEncodingException ;
4142import java .net .MalformedURLException ;
4243import java .net .URL ;
4344import java .util .ArrayList ;
@@ -82,7 +83,7 @@ public void init(String yarnConfDir, Configuration flinkConfig, Properties userC
8283 }
8384
8485 public AbstractYarnClusterDescriptor createPerJobClusterDescriptor (String flinkJarPath , Options launcherOptions , JobGraph jobGraph )
85- throws MalformedURLException {
86+ throws MalformedURLException , UnsupportedEncodingException {
8687
8788 String flinkConf = StringUtils .isEmpty (launcherOptions .getFlinkconf ()) ? DEFAULT_CONF_DIR : launcherOptions .getFlinkconf ();
8889 AbstractYarnClusterDescriptor clusterDescriptor = getClusterDescriptor (flinkConfig , yarnConf , flinkConf );
@@ -106,13 +107,7 @@ public AbstractYarnClusterDescriptor createPerJobClusterDescriptor(String flinkJ
106107 } else {
107108 throw new RuntimeException ("The Flink jar path is null" );
108109 }
109- // add user customized file to shipfile
110- if (!StringUtils .isBlank (launcherOptions .getAddShipfile ())) {
111- List <String > paths = ConfigParseUtil .parsePathFromStr (launcherOptions .getAddShipfile ());
112- paths .forEach (path -> {
113- shipFiles .add (new File (path ));
114- });
115- }
110+
116111 // classpath , all node need contain plugin jar
117112 String pluginLoadMode = launcherOptions .getPluginLoadMode ();
118113 if (StringUtils .equalsIgnoreCase (pluginLoadMode , EPluginLoadMode .CLASSPATH .name ())) {
@@ -125,6 +120,14 @@ public AbstractYarnClusterDescriptor createPerJobClusterDescriptor(String flinkJ
125120 + " Currently only classpath and shipfile are supported." );
126121 }
127122
123+ // add user customized file to shipfile
124+ if (!StringUtils .isBlank (launcherOptions .getAddShipfile ())) {
125+ List <String > paths = ConfigParseUtil .parsePathFromStr (launcherOptions .getAddShipfile ());
126+ paths .forEach (path -> {
127+ shipFiles .add (new File (path ));
128+ });
129+ }
130+
128131 clusterDescriptor .addShipFiles (shipFiles );
129132 clusterDescriptor .setName (launcherOptions .getName ());
130133 String queue = launcherOptions .getQueue ();
0 commit comments