org.apache.hadoop.tools.mapred
Class CopyMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,org.apache.hadoop.fs.FileStatus,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
      extended by org.apache.hadoop.tools.mapred.CopyMapper

public class CopyMapper
extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,org.apache.hadoop.fs.FileStatus,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>

Mapper class that executes the DistCp copy operation. Implements the o.a.h.mapreduce.Mapper<> interface.


Nested Class Summary
static class CopyMapper.Counter
          Hadoop counters for the DistCp CopyMapper.
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
CopyMapper()
           
 
Method Summary
 void map(org.apache.hadoop.io.Text relPath, org.apache.hadoop.fs.FileStatus sourceFileStatus, org.apache.hadoop.mapreduce.Mapper.Context context)
          Implementation of the Mapper<>::map().
 void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
          Implementation of the Mapper::setup() method.
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
cleanup, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyMapper

public CopyMapper()
Method Detail

setup

public void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           throws IOException,
                  InterruptedException
Implementation of the Mapper::setup() method. This extracts the DistCp- options specified in the Job's configuration, to set up the Job.

Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,org.apache.hadoop.fs.FileStatus,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
Parameters:
context - Mapper's context.
Throws:
IOException - On IO failure.
InterruptedException - If the job is interrupted.

map

public void map(org.apache.hadoop.io.Text relPath,
                org.apache.hadoop.fs.FileStatus sourceFileStatus,
                org.apache.hadoop.mapreduce.Mapper.Context context)
         throws IOException,
                InterruptedException
Implementation of the Mapper<>::map(). Does the copy.

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,org.apache.hadoop.fs.FileStatus,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
Parameters:
relPath - The target path.
sourceFileStatus - The source path.
Throws:
IOException
InterruptedException


Copyright © 2012 Apache Software Foundation. All Rights Reserved.