Skip to content

Commit 288a53a

Browse files
committed
addShipfile bug fix
1 parent fa0a242 commit 288a53a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

launcher/src/main/java/com/dtstack/flink/sql/launcher/executor/YarnJobClusterExecutor.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void exec() throws Exception {
7979
if (jobParamsInfo.getAddShipFile() != null) {
8080
List<String> addShipFilesPath = parsePathFromStr(jobParamsInfo.getAddShipFile());
8181
for (String path : addShipFilesPath) {
82-
shipFiles.addAll(getShipFiles(path, jobParamsInfo.getPluginLoadMode(), jobGraph, clusterDescriptor));
82+
shipFiles.add(getAddShipFile(path));
8383
}
8484
}
8585

@@ -122,6 +122,18 @@ protected List<File> getShipFiles(String flinkJarPath, String pluginLoadMode, Jo
122122
return shipFiles;
123123
}
124124

125+
private File getAddShipFile(String addShipFile) {
126+
if (StringUtils.isEmpty(addShipFile) || !new File(addShipFile).exists()) {
127+
throw new RuntimeException("path " + addShipFile + " is not exist");
128+
}
129+
File shipFile = new File(addShipFile);
130+
if (shipFile.isFile()) {
131+
return shipFile;
132+
} else {
133+
throw new RuntimeException("addShipfile only supports file path,E.g : {\\\"a.keytab\\\",\\\"b.txt\\\"}");
134+
}
135+
}
136+
125137
private void dealFlinkLibJar(String flinkJarPath, YarnClusterDescriptor clusterDescriptor, List<File> shipFiles) throws MalformedURLException {
126138
if (StringUtils.isEmpty(flinkJarPath) || !new File(flinkJarPath).exists()) {
127139
throw new RuntimeException("path " + flinkJarPath + " is not exist");

0 commit comments

Comments
 (0)