Search in sources :

Example 1 with SubmitSqoopXCommand

use of org.apache.oozie.command.wf.SubmitSqoopXCommand 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);
    }
}
Also used : SubmitPigXCommand(org.apache.oozie.command.wf.SubmitPigXCommand) SubmitHiveXCommand(org.apache.oozie.command.wf.SubmitHiveXCommand) SubmitMRXCommand(org.apache.oozie.command.wf.SubmitMRXCommand) SubmitSqoopXCommand(org.apache.oozie.command.wf.SubmitSqoopXCommand) CommandException(org.apache.oozie.command.CommandException) SubmitHttpXCommand(org.apache.oozie.command.wf.SubmitHttpXCommand)

Aggregations

CommandException (org.apache.oozie.command.CommandException)1 SubmitHiveXCommand (org.apache.oozie.command.wf.SubmitHiveXCommand)1 SubmitHttpXCommand (org.apache.oozie.command.wf.SubmitHttpXCommand)1 SubmitMRXCommand (org.apache.oozie.command.wf.SubmitMRXCommand)1 SubmitPigXCommand (org.apache.oozie.command.wf.SubmitPigXCommand)1 SubmitSqoopXCommand (org.apache.oozie.command.wf.SubmitSqoopXCommand)1