Package org.apache.drill.yarn.core
Class DfsFacade
java.lang.Object
org.apache.drill.yarn.core.DfsFacade
Facade to the distributed file system (DFS) system that implements
Drill-on-YARN related operations. Some operations are used by both the client
and AM applications.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
boolean
exists
(org.apache.hadoop.fs.Path path) org.apache.hadoop.fs.Path
getUploadPath
(File localArchiveFile) org.apache.hadoop.fs.Path
getUploadPath
(String baseName) boolean
org.apache.hadoop.yarn.api.records.LocalResource
makeResource
(org.apache.hadoop.fs.Path dfsPath, org.apache.hadoop.fs.FileStatus dfsFileStatus, org.apache.hadoop.yarn.api.records.LocalResourceType type, org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility) Create a local resource definition for YARN.void
removeDrillFile
(String fileName) void
uploadArchive
(File localArchiveFile, org.apache.hadoop.fs.Path destPath, String label)
-
Constructor Details
-
DfsFacade
public DfsFacade(com.typesafe.config.Config config)
-
-
Method Details
-
isLocalized
public boolean isLocalized() -
connect
- Throws:
DfsFacade.DfsFacadeException
-
exists
- Throws:
IOException
-
getUploadPath
-
getUploadPath
-
uploadArchive
public void uploadArchive(File localArchiveFile, org.apache.hadoop.fs.Path destPath, String label) throws DfsFacade.DfsFacadeException - Throws:
DfsFacade.DfsFacadeException
-
makeResource
public org.apache.hadoop.yarn.api.records.LocalResource makeResource(org.apache.hadoop.fs.Path dfsPath, org.apache.hadoop.fs.FileStatus dfsFileStatus, org.apache.hadoop.yarn.api.records.LocalResourceType type, org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility) throws DfsFacade.DfsFacadeException Create a local resource definition for YARN. A local resource is one that must be localized onto the remote node prior to running a command on that node.YARN uses the size and timestamp to check if the file has changed on HDFS and to check if YARN can use an existing copy, if any.
Resources are made public.
- Parameters:
dfsPath
- the path (relative or absolute) to the file on the configured file system (usually HDFS).dfsFileStatus
- the file status of the configured file systemtype
- local resource type (archive, file, or pattern)visibility
- local resource visibility (public, private, or application)- Returns:
- a YARN local resource records that contains information about path, size, type, resource and so on that YARN requires.
- Throws:
IOException
- if the resource does not exist on the configured file systemDfsFacade.DfsFacadeException
-
removeDrillFile
- Throws:
DfsFacade.DfsFacadeException
-