com.cloudera.sqoop.mapreduce
Class MySQLRecordExportMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<KEYIN,VALIN,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable>
      extended by com.cloudera.sqoop.mapreduce.MySQLExportMapper<org.apache.hadoop.io.LongWritable,SqoopRecord>
          extended by com.cloudera.sqoop.mapreduce.MySQLRecordExportMapper

public class MySQLRecordExportMapper
extends MySQLExportMapper<org.apache.hadoop.io.LongWritable,SqoopRecord>

mysqlimport-based exporter which accepts SqoopRecords (e.g., from SequenceFiles) to emit to the database.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Field Summary
 
Fields inherited from class com.cloudera.sqoop.mapreduce.MySQLExportMapper
checkpointDistInBytes, conf, DEFAULT_CHECKPOINT_BYTES, errSink, fifoFile, importStream, LOG, MYSQL_CHECKPOINT_BYTES_KEY, mysqlCharSet, mysqlImportProcess, outSink, passwordFile
 
Constructor Summary
MySQLRecordExportMapper()
           
 
Method Summary
 void map(org.apache.hadoop.io.LongWritable key, SqoopRecord val, org.apache.hadoop.mapreduce.Mapper.Context context)
          Export the table to MySQL by using mysqlimport to write the data to the database.
 
Methods inherited from class com.cloudera.sqoop.mapreduce.MySQLExportMapper
run, setup, writeRecord
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
cleanup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLRecordExportMapper

public MySQLRecordExportMapper()
Method Detail

map

public void map(org.apache.hadoop.io.LongWritable key,
                SqoopRecord val,
                org.apache.hadoop.mapreduce.Mapper.Context context)
         throws java.io.IOException,
                java.lang.InterruptedException
Export the table to MySQL by using mysqlimport to write the data to the database. Expects one SqoopRecord as the value. Ignores the key.

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


Copyright © 2010 Cloudera, Inc.