Class DfsFacade

java.lang.Object
org.apache.drill.yarn.core.DfsFacade

public class DfsFacade extends Object
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.
  • Constructor Details

    • DfsFacade

      public DfsFacade(com.typesafe.config.Config config)
  • Method Details

    • isLocalized

      public boolean isLocalized()
    • connect

      public void connect() throws DfsFacade.DfsFacadeException
      Throws:
      DfsFacade.DfsFacadeException
    • exists

      public boolean exists(org.apache.hadoop.fs.Path path) throws IOException
      Throws:
      IOException
    • getUploadPath

      public org.apache.hadoop.fs.Path getUploadPath(File localArchiveFile)
    • getUploadPath

      public org.apache.hadoop.fs.Path getUploadPath(String baseName)
    • 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 system
      type - 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 system
      DfsFacade.DfsFacadeException
    • removeDrillFile

      public void removeDrillFile(String fileName) throws DfsFacade.DfsFacadeException
      Throws:
      DfsFacade.DfsFacadeException