org.apache.hadoop.conf.Configurablepublic class SimpleCopyListing extends CopyListing
CopyListing.AclsNotSupportedException, CopyListing.XAttrsNotSupportedException| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_FILE_STATUS_SIZE |
|
static boolean |
DEFAULT_LISTING_CHECK |
|
static boolean |
DEFAULT_RANDOMIZE_FILE_LISTING |
|
static org.slf4j.Logger |
LOG |
|
static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
loopLocator |
| Modifier | Constructor | 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,
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) |
| Modifier and Type | Method | 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 org.slf4j.Logger LOG
public static final int DEFAULT_FILE_STATUS_SIZE
public static final boolean DEFAULT_RANDOMIZE_FILE_LISTING
public static final boolean DEFAULT_LISTING_CHECK
public static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> loopLocator
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 skipped@VisibleForTesting
protected 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 java.io.IOException, org.apache.hadoop.tools.CopyListing.InvalidInputException
CopyListingvalidatePaths in class CopyListingcontext - - Distcp contextjava.io.IOException - any Exception with FSorg.apache.hadoop.tools.CopyListing.InvalidInputException - If inputs are invalidprotected void doBuildListing(org.apache.hadoop.fs.Path pathToListingFile,
DistCpContext context)
throws java.io.IOException
CopyListingdoBuildListing in class CopyListingpathToListingFile - Path on HDFS where the listing file is written.context - - Distcp contextjava.io.IOException - Thrown on failure to create the listing file.@VisibleForTesting
protected void doBuildListingWithSnapshotDiff(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpContext context)
throws java.io.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 optionsjava.io.IOException - if unable to construct the fileList@VisibleForTesting
protected void doBuildListing(org.apache.hadoop.io.SequenceFile.Writer fileListWriter,
DistCpContext context)
throws java.io.IOException
DistCpUtils.getRelativePath(org.apache.hadoop.tools.FileListingEntry) 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 optionsjava.io.IOException - if unable to construct the fileListprotected 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–2025 Apache Software Foundation. All rights reserved.