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,
DistCpOptions options)
Build listing function creates the input listing that distcp uses to
perform the copy.
|
protected abstract void |
doBuildListing(org.apache.hadoop.fs.Path pathToListFile,
DistCpOptions options)
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,
DistCpOptions options)
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 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(DistCpOptions options)
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,
DistCpOptions options)
throws IOException
pathToListFile - - Output file where the listing would be storedoptions - - Input options to distcpIOException - - Exception if anyprotected abstract void validatePaths(DistCpOptions options) throws IOException, org.apache.hadoop.tools.CopyListing.InvalidInputException
options - - Input optionsInvalidInputException - If inputs are invalidIOException - any Exception with FSorg.apache.hadoop.tools.CopyListing.InvalidInputExceptionprotected abstract void doBuildListing(org.apache.hadoop.fs.Path pathToListFile,
DistCpOptions options)
throws IOException
pathToListFile - Path on HDFS where the listing file is written.options - Input Options for DistCp (indicating source/target paths.)IOException - 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()
public static CopyListing getCopyListing(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.security.Credentials credentials, DistCpOptions options) throws IOException
configuration - The input configuration.credentials - Credentials object on which the FS delegation tokens are cachedoptions - The input Options, to help choose the appropriate CopyListing Implementation.IOException - - Exception if anyCopyright © 2016 Apache Software Foundation. All Rights Reserved.