Class DistCp
java.lang.Object
fr.ens.biologie.genomique.eoulsan.modules.mgmt.hadoop.DistCp
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.util.Tool
A Map-reduce program to recursively copy directories between different file-systems.
- Since:
- 1.0
- Author:
- The hadoop project
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn exception class for duplicated source files. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopy(org.apache.hadoop.conf.Configuration conf, String srcPath, String destPath, org.apache.hadoop.fs.Path logPath, boolean srcAsList, boolean ignoreReadFailures) Deprecated.org.apache.hadoop.conf.ConfigurationgetConf()static StringGet a random id.intThis is the main driver for recursively copying directories across file systems.voidrunWithException(String[] args) This is the main driver for recursively copying directories across file systems.voidsetConf(org.apache.hadoop.conf.Configuration conf)
-
Constructor Details
-
DistCp
public DistCp(org.apache.hadoop.conf.Configuration conf) Constructor.- Parameters:
conf- Hadoop configuration
-
-
Method Details
-
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf) - Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable
-
getConf
public org.apache.hadoop.conf.Configuration getConf()- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
copy
@Deprecated public static void copy(org.apache.hadoop.conf.Configuration conf, String srcPath, String destPath, org.apache.hadoop.fs.Path logPath, boolean srcAsList, boolean ignoreReadFailures) throws IOException Deprecated.Copy a file.- Parameters:
conf- Hadoop configurationsrcPath- sourcedestPath- destinationlogPath- log pathsrcAsList- source is a listignoreReadFailures- true to ignore read faillure- Throws:
IOException- if an error occurs while copying data
-
run
This is the main driver for recursively copying directories across file systems. It takes at least two cmdline parameters. A source URL and a destination URL. It then essentially does an "ls -lR" on the source URL, and writes the output in a round-robin manner to all the map input files. The mapper actually copies the files allotted to it. The reduce is empty.- Specified by:
runin interfaceorg.apache.hadoop.util.Tool
-
runWithException
This is the main driver for recursively copying directories across file systems. It takes at least two cmdline parameters. A source URL and a destination URL. It then essentially does an "ls -lR" on the source URL, and writes the output in a round-robin manner to all the map input files. The mapper actually copies the files allotted to it. The reduce is empty.- Parameters:
args- arguments- Throws:
EoulsanException- if an error occurs
-
getRandomId
Get a random id.- Returns:
- a String with a random id
-