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

Using consistent method to get Yarn application directory

    XMLWordPrintableJSON

Details

    Description

      The Yarn application directory of Flink is "/user/

      {user.name}

      /.flink", but this logic is separated in different places.

      1. org.apache.flink.yarn.YarnClusterDescriptor#getYarnFilesDir

      	private Path getYarnFilesDir(final ApplicationId appId) throws IOException {
      		final FileSystem fileSystem = FileSystem.get(yarnConfiguration);
      		final Path homeDir = fileSystem.getHomeDirectory();
      		return new Path(homeDir, ".flink/" + appId + '/');
      	}
      

      2. org.apache.flink.yarn.Utils#uploadLocalFileToRemote

      		// copy resource to HDFS
      		String suffix =
      			".flink/"
      				+ appId
      				+ (relativeTargetPath.isEmpty() ? "" : "/" + relativeTargetPath)
      				+ "/" + localSrcPath.getName();
      
      		Path dst = new Path(homedir, suffix);
      

      We can extract `getYarnFilesDir` method to `org.apache.flink.yarn.Utils`, and use this method to get Yarn application directory in all the other places.

      Attachments

        Issue Links

          Activity

            People

              victor-wong jiasheng55
              victor-wong jiasheng55
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h