public class SimpleCopyListing extends CopyListing
CopyListing.AclsNotSupportedException, CopyListing.XAttrsNotSupportedException| Modifier | Constructor and Description |
|---|---|
protected |
SimpleCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials)
Protected constructor, to initialize configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doBuildListing(org.apache.hadoop.fs.Path pathToListingFile,
DistCpOptions options)
The interface to be implemented by sub-classes, to create the source/target file listing.
|
void |
doBuildListing(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpOptions options)
Collect the list of
|
protected long |
getBytesToCopy()
Return the total bytes that distCp should copy for the source paths
This doesn't consider whether file is same should be skipped during copy
|
protected long |
getNumberOfPaths()
Return the total number of paths to distcp, includes directories as well
This doesn't consider whether file/dir is already present and should be skipped during copy
|
protected boolean |
shouldCopy(org.apache.hadoop.fs.Path path,
DistCpOptions options)
Provide an option to skip copy of a path, Allows for exclusion
of files such as
FileOutputCommitter.SUCCEEDED_FILE_NAME |
protected void |
validatePaths(DistCpOptions options)
Validate input and output paths
|
buildListing, getCopyListing, getCredentials, setCredentialsprotected SimpleCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials)
configuration - The input configuration, with which the source/target FileSystems may be accessed.credentials - - Credentials object on which the FS delegation tokens are cached. If null
delegation token caching is skippedprotected void validatePaths(DistCpOptions options) throws IOException, org.apache.hadoop.tools.CopyListing.InvalidInputException
CopyListingvalidatePaths in class CopyListingoptions - - Input optionsIOExceptionorg.apache.hadoop.tools.CopyListing.InvalidInputExceptionpublic void doBuildListing(org.apache.hadoop.fs.Path pathToListingFile,
DistCpOptions options)
throws IOException
doBuildListing in class CopyListingpathToListingFile - Path on HDFS where the listing file is written.options - Input Options for DistCp (indicating source/target paths.)IOExceptionpublic void doBuildListing(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpOptions options)
throws IOException
DistCpUtils.getRelativePath(org.apache.hadoop.fs.Path, org.apache.hadoop.fs.Path) for
how relative path is computed.
See computeSourceRootPath method for how the root path of the source is
computed.fileListWriter - options - IOExceptionprotected boolean shouldCopy(org.apache.hadoop.fs.Path path,
DistCpOptions options)
FileOutputCommitter.SUCCEEDED_FILE_NAMEpath - - Path being considered for copy while building the file listingoptions - - Input options passed during DistCp invocationprotected long getBytesToCopy()
getBytesToCopy in class CopyListingprotected long getNumberOfPaths()
getNumberOfPaths in class CopyListingCopyright © 2015 Apache Software Foundation. All Rights Reserved.