org.apache.hadoop.util
Class CopyFiles.FSCopyFilesMapper

java.lang.Object
  extended by org.apache.hadoop.util.CopyFiles.FSCopyFilesMapper
All Implemented Interfaces:
Closeable, JobConfigurable, Mapper<LongWritable,org.apache.hadoop.util.CopyFiles.FilePair,WritableComparable,Text>
Enclosing class:
CopyFiles

public static class CopyFiles.FSCopyFilesMapper
extends Object
implements Mapper<LongWritable,org.apache.hadoop.util.CopyFiles.FilePair,WritableComparable,Text>

FSCopyFilesMapper: The mapper for copying files between FileSystems.


Constructor Summary
CopyFiles.FSCopyFilesMapper()
           
 
Method Summary
 void close()
          Called after the last call to any other method on this object to free and/or flush resources.
 void configure(JobConf job)
          Mapper configuration.
 void map(LongWritable key, org.apache.hadoop.util.CopyFiles.FilePair value, OutputCollector<WritableComparable,Text> out, Reporter reporter)
          Map method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyFiles.FSCopyFilesMapper

public CopyFiles.FSCopyFilesMapper()
Method Detail

configure

public void configure(JobConf job)
Mapper configuration. Extracts source and destination file system, as well as top-level paths on source and destination directories. Gets the named file systems, to be used later in map.

Specified by:
configure in interface JobConfigurable
Parameters:
job - the configuration

map

public void map(LongWritable key,
                org.apache.hadoop.util.CopyFiles.FilePair value,
                OutputCollector<WritableComparable,Text> out,
                Reporter reporter)
         throws IOException
Map method. Copies one file from source file system to destination.

Specified by:
map in interface Mapper<LongWritable,org.apache.hadoop.util.CopyFiles.FilePair,WritableComparable,Text>
Parameters:
key - src len
value - FilePair (FileStatus src, Path dst)
out - Log of failed copies
reporter -
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: Closeable
Called after the last call to any other method on this object to free and/or flush resources. Typical implementations do nothing.

Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2006 The Apache Software Foundation