wangyang0918 commented on a change in pull request #10193: [FLINK-13938][yarn]
Use pre-uploaded flink binary to accelerate flink submission
URL: https://github.com/apache/flink/pull/10193#discussion_r352263865
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
##########
@@ -596,6 +644,30 @@ static ContainerLaunchContext createTaskExecutorContext(
return ctx;
}
+ static Map<String, FileStatus> getPreUploadedFlinkFiles(
+ @Nullable String flinkSharedBinary,
+ Configuration yarnConfiguration) {
+ Map<String, FileStatus> flinkShareFiles = new HashMap<>();
+ if (flinkSharedBinary != null) {
+ try {
+ FileSystem fileSystem =
FileSystem.get(yarnConfiguration);
+ Path flinkSharedPath = new
Path(flinkSharedBinary);
+ if (fileSystem.exists(flinkSharedPath)) {
+ RemoteIterator<LocatedFileStatus>
iterable = fileSystem.listFiles(flinkSharedPath, true);
+ while (iterable.hasNext()) {
+ LocatedFileStatus
locatedFileStatus = iterable.next();
+ String relative =
flinkSharedPath.toUri().relativize(locatedFileStatus.getPath().toUri()).getPath();
+ flinkShareFiles.put(relative,
locatedFileStatus);
+ LOG.debug("Found pre-uploaded
file {} under {}", relative, flinkSharedPath);
+ }
+ }
+ } catch (IOException e) {
+ LOG.warn("Error to get the ");
Review comment:
Nice catch. I will fix it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services