com.cloudera.sqoop.mapreduce
Class MySQLDumpMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<java.lang.String,org.apache.hadoop.io.NullWritable,java.lang.String,org.apache.hadoop.io.NullWritable>
      extended by com.cloudera.sqoop.mapreduce.MySQLDumpMapper

public class MySQLDumpMapper
extends org.apache.hadoop.mapreduce.Mapper<java.lang.String,org.apache.hadoop.io.NullWritable,java.lang.String,org.apache.hadoop.io.NullWritable>

Mapper that opens up a pipe to mysqldump and pulls data directly.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
MySQLDumpMapper()
           
 
Method Summary
 void map(java.lang.String splitConditions, org.apache.hadoop.io.NullWritable val, org.apache.hadoop.mapreduce.Mapper.Context context)
          Import the table into HDFS by using mysqldump to pull out the data from the database and upload the files directly to HDFS.
protected  void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 
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
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

MySQLDumpMapper

public MySQLDumpMapper()
Method Detail

map

public void map(java.lang.String splitConditions,
                org.apache.hadoop.io.NullWritable val,
                org.apache.hadoop.mapreduce.Mapper.Context context)
         throws java.io.IOException,
                java.lang.InterruptedException
Import the table into HDFS by using mysqldump to pull out the data from the database and upload the files directly to HDFS.

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<java.lang.String,org.apache.hadoop.io.NullWritable,java.lang.String,org.apache.hadoop.io.NullWritable>
Throws:
java.io.IOException
java.lang.InterruptedException

setup

protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<java.lang.String,org.apache.hadoop.io.NullWritable,java.lang.String,org.apache.hadoop.io.NullWritable>


Copyright © 2010 Cloudera, Inc.