Search in sources :

Example 6 with CopyListing

use of org.apache.hadoop.tools.CopyListing in project hadoop by apache.

the class DistCp method createInputFileListing.

/**
   * Create input listing by invoking an appropriate copy listing
   * implementation. Also add delegation tokens for each path
   * to job's credential store
   *
   * @param job - Handle to job
   * @return Returns the path where the copy listing is created
   * @throws IOException - If any
   */
protected Path createInputFileListing(Job job) throws IOException {
    Path fileListingPath = getFileListingPath();
    CopyListing copyListing = CopyListing.getCopyListing(job.getConfiguration(), job.getCredentials(), inputOptions);
    copyListing.buildListing(fileListingPath, inputOptions);
    return fileListingPath;
}
Also used : Path(org.apache.hadoop.fs.Path) CopyListing(org.apache.hadoop.tools.CopyListing)

Aggregations

Path (org.apache.hadoop.fs.Path)6 CopyListing (org.apache.hadoop.tools.CopyListing)6 Configuration (org.apache.hadoop.conf.Configuration)4 FileSystem (org.apache.hadoop.fs.FileSystem)4 DistCpOptions (org.apache.hadoop.tools.DistCpOptions)4 GlobbedCopyListing (org.apache.hadoop.tools.GlobbedCopyListing)4 IOException (java.io.IOException)3 JobContextImpl (org.apache.hadoop.mapreduce.task.JobContextImpl)3 ArrayList (java.util.ArrayList)1 FsPermission (org.apache.hadoop.fs.permission.FsPermission)1 SequenceFile (org.apache.hadoop.io.SequenceFile)1 Text (org.apache.hadoop.io.Text)1 CopyListingFileStatus (org.apache.hadoop.tools.CopyListingFileStatus)1