Package org.apache.hadoop.yarn.util
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
ConstructorsConstructorDescriptionFSDownload(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 TypeMethodDescriptionorg.apache.hadoop.fs.Pathcall()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 booleanisPublic(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.
-
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 IOExceptionReturns 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
-