use of org.apache.oozie.command.wf.SubmitMRXCommand in project oozie by apache.
the class DagEngine method submitHttpJob.
/**
* Submit a pig/hive/mapreduce job through HTTP.
* <p>
* It validates configuration properties.
*
* @param conf job configuration.
* @param jobType job type - can be "pig", "hive", "sqoop" or "mapreduce".
* @return the job Id.
* @throws DagEngineException thrown if the job could not be created.
*/
public String submitHttpJob(Configuration conf, String jobType) throws DagEngineException {
validateSubmitConfiguration(conf);
try {
String jobId;
SubmitHttpXCommand submit = null;
if (jobType.equals("pig")) {
submit = new SubmitPigXCommand(conf);
} else if (jobType.equals("mapreduce")) {
submit = new SubmitMRXCommand(conf);
} else if (jobType.equals("hive")) {
submit = new SubmitHiveXCommand(conf);
} else if (jobType.equals("sqoop")) {
submit = new SubmitSqoopXCommand(conf);
}
jobId = submit.call();
start(jobId);
return jobId;
} catch (CommandException ex) {
throw new DagEngineException(ex);
}
}
Aggregations