com.cloudera.sqoop.mapreduce
Class MySQLRecordExportMapper
java.lang.Object
org.apache.hadoop.mapreduce.Mapper<KEYIN,VALIN,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable>
com.cloudera.sqoop.mapreduce.MySQLExportMapper<org.apache.hadoop.io.LongWritable,SqoopRecord>
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 classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper |
org.apache.hadoop.mapreduce.Mapper.Context |
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 |
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 org.apache.hadoop.mapreduce.Mapper |
cleanup |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MySQLRecordExportMapper
public MySQLRecordExportMapper()
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.