public abstract class CopyListing
extends org.apache.hadoop.conf.Configured
| Modifier and Type | Class and Description |
|---|---|
static class |
CopyListing.AclsNotSupportedException |
static class |
CopyListing.XAttrsNotSupportedException |
| Modifier | Constructor and Description |
|---|---|
protected |
CopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials)
Protected constructor, to initialize configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildListing(org.apache.hadoop.fs.Path pathToListFile,
DistCpContext distCpContext)
Build listing function creates the input listing that distcp uses to
perform the copy.
|
protected abstract void |
doBuildListing(org.apache.hadoop.fs.Path pathToListFile,
DistCpContext distCpContext)
The interface to be implemented by sub-classes, to create the source/target file listing.
|
protected abstract 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
|
static CopyListing |
getCopyListing(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.security.Credentials credentials,
DistCpContext context)
Public Factory method with which the appropriate CopyListing implementation may be retrieved.
|
protected org.apache.hadoop.security.Credentials |
getCredentials()
get credentials to update the delegation tokens for accessed FS objects
|
protected org.apache.hadoop.io.Text |
getFileListingKey(org.apache.hadoop.fs.Path sourcePathRoot,
CopyListingFileStatus fileStatus)
Returns the key for an entry in the copy listing sequence file.
|
protected CopyListingFileStatus |
getFileListingValue(CopyListingFileStatus fileStatus)
Returns the value for an entry in the copy listing sequence file.
|
protected abstract 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 void |
setCredentials(org.apache.hadoop.security.Credentials credentials)
set Credentials store, on which FS delegatin token will be cached
|
protected abstract void |
validatePaths(DistCpContext distCpContext)
Validate input and output paths
|
protected CopyListing(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 skippedpublic final void buildListing(org.apache.hadoop.fs.Path pathToListFile,
DistCpContext distCpContext)
throws IOException
pathToListFile - - Output file where the listing would be storeddistCpContext - - distcp context associated with input optionsIOException - - Exception if anyprotected abstract void validatePaths(DistCpContext distCpContext) throws IOException, org.apache.hadoop.tools.CopyListing.InvalidInputException
distCpContext - - Distcp contextInvalidInputException - If inputs are invalidIOException - any Exception with FSorg.apache.hadoop.tools.CopyListing.InvalidInputExceptionprotected abstract void doBuildListing(org.apache.hadoop.fs.Path pathToListFile,
DistCpContext distCpContext)
throws IOException
pathToListFile - Path on HDFS where the listing file is written.distCpContext - - Distcp contextIOException - Thrown on failure to create the listing file.protected abstract long getBytesToCopy()
protected abstract long getNumberOfPaths()
protected void setCredentials(org.apache.hadoop.security.Credentials credentials)
credentials - - Credentials objectprotected org.apache.hadoop.security.Credentials getCredentials()
protected org.apache.hadoop.io.Text getFileListingKey(org.apache.hadoop.fs.Path sourcePathRoot,
CopyListingFileStatus fileStatus)
sourcePathRoot - the root source path for determining the relative
target pathfileStatus - the copy listing file statusprotected CopyListingFileStatus getFileListingValue(CopyListingFileStatus fileStatus)
fileStatus - the copy listing file statuspublic static CopyListing getCopyListing(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.security.Credentials credentials, DistCpContext context) throws IOException
configuration - The input configuration.credentials - Credentials object on which the FS delegation tokens are cachedcontext - Distcp context with associated input optionsIOException - - Exception if anyCopyright © 2008–2020 Apache Software Foundation. All rights reserved.