Class FSDownload

java.lang.Object
org.apache.hadoop.yarn.util.FSDownload
All Implemented Interfaces:
Callable<org.apache.hadoop.fs.Path>

@LimitedPrivate({"YARN","MapReduce"}) public class FSDownload extends Object implements Callable<org.apache.hadoop.fs.Path>
Download a single URL to the local disk.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FSDownload(org.apache.hadoop.fs.FileContext files, org.apache.hadoop.security.UserGroupInformation ugi, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path destDirPath, org.apache.hadoop.yarn.api.records.LocalResource resource)
     
    FSDownload(org.apache.hadoop.fs.FileContext files, org.apache.hadoop.security.UserGroupInformation ugi, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path destDirPath, org.apache.hadoop.yarn.api.records.LocalResource resource, org.apache.hadoop.thirdparty.com.google.common.cache.LoadingCache<org.apache.hadoop.fs.Path,Future<org.apache.hadoop.fs.FileStatus>> statCache)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.fs.Path
     
    static org.apache.hadoop.thirdparty.com.google.common.cache.CacheLoader<org.apache.hadoop.fs.Path,Future<org.apache.hadoop.fs.FileStatus>>
    createStatusCacheLoader(org.apache.hadoop.conf.Configuration conf)
    Creates the cache loader for the status loading cache.
    static boolean
    isPublic(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path current, org.apache.hadoop.fs.FileStatus sStat, org.apache.hadoop.thirdparty.com.google.common.cache.LoadingCache<org.apache.hadoop.fs.Path,Future<org.apache.hadoop.fs.FileStatus>> statCache)
    Returns a boolean to denote whether a cache file is visible to all (public) or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FSDownload

      public FSDownload(org.apache.hadoop.fs.FileContext files, org.apache.hadoop.security.UserGroupInformation ugi, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path destDirPath, org.apache.hadoop.yarn.api.records.LocalResource resource)
    • FSDownload

      public FSDownload(org.apache.hadoop.fs.FileContext files, org.apache.hadoop.security.UserGroupInformation ugi, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path destDirPath, org.apache.hadoop.yarn.api.records.LocalResource resource, org.apache.hadoop.thirdparty.com.google.common.cache.LoadingCache<org.apache.hadoop.fs.Path,Future<org.apache.hadoop.fs.FileStatus>> statCache)
  • Method Details

    • createStatusCacheLoader

      public static org.apache.hadoop.thirdparty.com.google.common.cache.CacheLoader<org.apache.hadoop.fs.Path,Future<org.apache.hadoop.fs.FileStatus>> createStatusCacheLoader(org.apache.hadoop.conf.Configuration conf)
      Creates the cache loader for the status loading cache. This should be used to create an instance of the status cache that is passed into the FSDownload constructor.
      Parameters:
      conf - configuration.
      Returns:
      cache loader for the status loading cache.
    • isPublic

      @Private public static boolean isPublic(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path current, org.apache.hadoop.fs.FileStatus sStat, org.apache.hadoop.thirdparty.com.google.common.cache.LoadingCache<org.apache.hadoop.fs.Path,Future<org.apache.hadoop.fs.FileStatus>> statCache) throws IOException
      Returns a boolean to denote whether a cache file is visible to all (public) or not.
      Parameters:
      fs - fileSystem.
      current - current path.
      sStat - file status.
      statCache - stat cache.
      Returns:
      true if the path in the current path is visible to all, false otherwise
      Throws:
      IOException - io error occur.
    • call

      public org.apache.hadoop.fs.Path call() throws Exception
      Specified by:
      call in interface Callable<org.apache.hadoop.fs.Path>
      Throws:
      Exception