com.cloudera.sqoop.mapreduce
Class MySQLTextExportMapper

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,org.apache.hadoop.io.Text>
          extended by com.cloudera.sqoop.mapreduce.MySQLTextExportMapper

public class MySQLTextExportMapper
extends MySQLExportMapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>

mysqlimport-based exporter which accepts lines of text from files in HDFS 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
MySQLTextExportMapper()
           
 
Method Summary
 void map(org.apache.hadoop.io.LongWritable key, org.apache.hadoop.io.Text val, org.apache.hadoop.mapreduce.Mapper.Context context)
          Export the table to MySQL by using mysqlimport to write the data to the database.
protected  void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 
Methods inherited from class com.cloudera.sqoop.mapreduce.MySQLExportMapper
run, 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

MySQLTextExportMapper

public MySQLTextExportMapper()
Method Detail

setup

protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
Overrides:
setup in class MySQLExportMapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>

map

public void map(org.apache.hadoop.io.LongWritable key,
                org.apache.hadoop.io.Text 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 delimited text record as the 'val'; ignores the key.

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


Copyright © 2010 Cloudera, Inc.