Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-32809

YarnClusterDescriptor.isarchiveonlyincludedinShipArchiveFiles dose not work as expected

    XMLWordPrintableJSON

Details

    Description

      YarnClusterDescriptor.isarchiveonlyincludedinShipArchiveFiles(List<File> shipFiles) check wether the shipFiles are all archive files, but it dose not work as expected.

      public static boolean isArchiveOnlyIncludedInShipArchiveFiles(List<File> shipFiles) {
          return shipFiles.stream()
                  .filter(File::isFile)
                  .map(File::getName)
                  .map(String::toLowerCase)
                  .allMatch(
                          name ->
                                  name.endsWith(".tar.gz")
                                          || name.endsWith(".tar")
                                          || name.endsWith(".tgz")
                                          || name.endsWith(".dst")
                                          || name.endsWith(".jar")
                                          || name.endsWith(".zip"));
      } 

      When we pass a directory and an archive file it should return false but it returns true. 

      // dir1 is a directory and archive.zip is an archive file
      List<File> files = Arrays.asList(new File("/tmp/dir1"), new File("/tmp/archive.zip")); 
      boolean result = isArchiveOnlyIncludedInShipArchiveFiles(files);
      System.out.println(result); // Print true but is should print false

      If flink user want to add directory as ship file, they should use configuration: yarn.ship-files .

      Attachments

        Issue Links

          Activity

            People

              easonqin junzhong qin
              easonqin junzhong qin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: