public class SimpleCopyListing extends CopyListing
CopyListing.AclsNotSupportedException, CopyListing.XAttrsNotSupportedException| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FILE_STATUS_SIZE |
static boolean |
DEFAULT_RANDOMIZE_FILE_LISTING |
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials)
Protected constructor, to initialize configuration.
|
protected |
SimpleCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.tools.DistCpSync distCpSync) |
protected |
SimpleCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials,
int numListstatusThreads,
int fileStatusLimit,
boolean randomizeFileListing) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doBuildListing(org.apache.hadoop.fs.Path pathToListingFile,
DistCpContext context)
The interface to be implemented by sub-classes, to create the source/target file listing.
|
protected void |
doBuildListing(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpContext context)
Collect the list of
<sourceRelativePath, sourceFileStatus>
to be copied and write to the sequence file.
|
protected void |
doBuildListingWithSnapshotDiff(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpContext context)
Build a copy list based on the snapshot diff report.
|
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)
Provide an option to skip copy of a path, Allows for exclusion
of files such as
FileOutputCommitter.SUCCEEDED_FILE_NAME |
protected void |
validatePaths(DistCpContext context)
Validate input and output paths
|
buildListing, getCopyListing, getCredentials, getFileListingKey, getFileListingValue, setCredentialspublic static final int DEFAULT_FILE_STATUS_SIZE
public static final boolean DEFAULT_RANDOMIZE_FILE_LISTING
protected 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 SimpleCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials,
int numListstatusThreads,
int fileStatusLimit,
boolean randomizeFileListing)
protected SimpleCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.tools.DistCpSync distCpSync)
protected void validatePaths(DistCpContext context) throws IOException, org.apache.hadoop.tools.CopyListing.InvalidInputException
CopyListingvalidatePaths in class CopyListingcontext - - Distcp contextIOException - any Exception with FSorg.apache.hadoop.tools.CopyListing.InvalidInputExceptionprotected void doBuildListing(org.apache.hadoop.fs.Path pathToListingFile,
DistCpContext context)
throws IOException
CopyListingdoBuildListing in class CopyListingpathToListingFile - Path on HDFS where the listing file is written.context - - Distcp contextIOException - Thrown on failure to create the listing file.protected void doBuildListingWithSnapshotDiff(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpContext context)
throws IOException
DistCpSync.sync(). An item can be
created/modified and renamed, in which case, the target path is put
into the list.fileListWriter - the list for holding processed resultscontext - The DistCp context with associated input optionsIOExceptionprotected void doBuildListing(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpContext context)
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 - context - The distcp context with associated input optionsIOExceptionprotected boolean shouldCopy(org.apache.hadoop.fs.Path path)
FileOutputCommitter.SUCCEEDED_FILE_NAMEpath - - Path being considered for copy while building the file listingprotected long getBytesToCopy()
getBytesToCopy in class CopyListingprotected long getNumberOfPaths()
getNumberOfPaths in class CopyListingCopyright © 2008–2020 Apache Software Foundation. All rights reserved.