|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cloudera.sqoop.mapreduce.JobBase
com.cloudera.sqoop.mapreduce.ExportJobBase
public class ExportJobBase
Base class for running an export MapReduce job.
Field Summary | |
---|---|
protected ExportJobContext |
context
|
static java.lang.String |
EXPORT_MAP_TASKS_KEY
Number of map tasks to use for an export. |
static org.apache.commons.logging.Log |
LOG
|
static java.lang.String |
SQOOP_EXPORT_TABLE_CLASS_KEY
What SqoopRecord class to use to read a record for export. |
Fields inherited from class com.cloudera.sqoop.mapreduce.JobBase |
---|
inputFormatClass, mapperClass, options, outputFormatClass |
Constructor Summary | |
---|---|
ExportJobBase(ExportJobContext ctxt)
|
|
ExportJobBase(ExportJobContext ctxt,
java.lang.Class<? extends org.apache.hadoop.mapreduce.Mapper> mapperClass,
java.lang.Class<? extends org.apache.hadoop.mapreduce.InputFormat> inputFormatClass,
java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat> outputFormatClass)
|
Method Summary | |
---|---|
protected void |
configureInputFormat(org.apache.hadoop.mapreduce.Job job,
java.lang.String tableName,
java.lang.String tableClassName,
java.lang.String splitByCol)
Configure the inputformat to use for the job. |
protected void |
configureMapper(org.apache.hadoop.mapreduce.Job job,
java.lang.String tableName,
java.lang.String tableClassName)
Set the mapper class implementation to use in the job, as well as any related configuration (e.g., map output types). |
protected int |
configureNumTasks(org.apache.hadoop.mapreduce.Job job)
Configure the number of map/reduce tasks to use in the job. |
protected java.lang.Class<? extends org.apache.hadoop.mapreduce.InputFormat> |
getInputFormatClass()
|
protected org.apache.hadoop.fs.Path |
getInputPath()
|
protected java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat> |
getOutputFormatClass()
|
protected boolean |
inputIsSequenceFiles()
|
static boolean |
isSequenceFiles(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path p)
|
void |
runExport()
Run an export job to dump a table from HDFS to a database. |
protected boolean |
runJob(org.apache.hadoop.mapreduce.Job job)
Actually run the MapReduce job. |
Methods inherited from class com.cloudera.sqoop.mapreduce.JobBase |
---|
configureOutputFormat, getMapperClass, loadJars, setInputFormatClass, setMapperClass, setOptions, setOutputFormatClass, unloadJars |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
public static final java.lang.String SQOOP_EXPORT_TABLE_CLASS_KEY
public static final java.lang.String EXPORT_MAP_TASKS_KEY
protected ExportJobContext context
Constructor Detail |
---|
public ExportJobBase(ExportJobContext ctxt)
public ExportJobBase(ExportJobContext ctxt, java.lang.Class<? extends org.apache.hadoop.mapreduce.Mapper> mapperClass, java.lang.Class<? extends org.apache.hadoop.mapreduce.InputFormat> inputFormatClass, java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat> outputFormatClass)
Method Detail |
---|
public static boolean isSequenceFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path p) throws java.io.IOException
java.io.IOException
protected org.apache.hadoop.fs.Path getInputPath() throws java.io.IOException
java.io.IOException
protected void configureInputFormat(org.apache.hadoop.mapreduce.Job job, java.lang.String tableName, java.lang.String tableClassName, java.lang.String splitByCol) throws java.lang.ClassNotFoundException, java.io.IOException
JobBase
configureInputFormat
in class JobBase
java.lang.ClassNotFoundException
java.io.IOException
protected java.lang.Class<? extends org.apache.hadoop.mapreduce.InputFormat> getInputFormatClass() throws java.lang.ClassNotFoundException
getInputFormatClass
in class JobBase
java.lang.ClassNotFoundException
protected java.lang.Class<? extends org.apache.hadoop.mapreduce.OutputFormat> getOutputFormatClass() throws java.lang.ClassNotFoundException
getOutputFormatClass
in class JobBase
java.lang.ClassNotFoundException
protected void configureMapper(org.apache.hadoop.mapreduce.Job job, java.lang.String tableName, java.lang.String tableClassName) throws java.lang.ClassNotFoundException, java.io.IOException
JobBase
configureMapper
in class JobBase
java.lang.ClassNotFoundException
java.io.IOException
protected int configureNumTasks(org.apache.hadoop.mapreduce.Job job) throws java.io.IOException
JobBase
configureNumTasks
in class JobBase
java.io.IOException
protected boolean runJob(org.apache.hadoop.mapreduce.Job job) throws java.lang.ClassNotFoundException, java.io.IOException, java.lang.InterruptedException
JobBase
runJob
in class JobBase
java.lang.ClassNotFoundException
java.io.IOException
java.lang.InterruptedException
public void runExport() throws ExportException, java.io.IOException
java.io.IOException
- if the export job encounters an IO error
ExportException
- if the job fails unexpectedly or is misconfigured.protected boolean inputIsSequenceFiles()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |