org.apache.hadoop.util
Class CopyFiles

java.lang.Object
  extended by org.apache.hadoop.util.ToolBase
      extended by org.apache.hadoop.util.CopyFiles
All Implemented Interfaces:
Configurable, Tool

public class CopyFiles
extends ToolBase

A Map-reduce program to recursively copy directories between diffferent file-systems.

Author:
Milind Bhandarkar

Nested Class Summary
static class CopyFiles.CopyFilesMapper
          Mappper class for Copying files.
static class CopyFiles.CopyFilesReducer
           
 
Field Summary
 
Fields inherited from class org.apache.hadoop.util.ToolBase
conf, LOG
 
Constructor Summary
CopyFiles()
           
 
Method Summary
static void main(String[] args)
           
 int run(String[] args)
          This is the main driver for recursively copying directories across file systems.
 void setConf(Configuration conf)
          Set the configuration to be used by this object.
 
Methods inherited from class org.apache.hadoop.util.ToolBase
doMain, executeCommand, getConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyFiles

public CopyFiles()
Method Detail

setConf

public void setConf(Configuration conf)
Description copied from interface: Configurable
Set the configuration to be used by this object.

Specified by:
setConf in interface Configurable
Overrides:
setConf in class ToolBase

run

public int run(String[] args)
        throws IOException
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 aa round-robin manner to all the map input files. The mapper actually copies the files allotted to it. And the reduce is empty.

Parameters:
args - command specific arguments
Returns:
exit code
Throws:
IOException

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2006 The Apache Software Foundation