com.cloudera.sqoop.mapreduce
Class MySQLTextExportMapper
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,org.apache.hadoop.io.Text>
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 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,
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 org.apache.hadoop.mapreduce.Mapper |
cleanup |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MySQLTextExportMapper
public MySQLTextExportMapper()
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.