Search in sources :

Example 1 with EJobType

use of com.dtstack.taier.pluginapi.enums.EJobType in project Taier by DTStack.

the class SparkYarnClient method processSubmitJobWithType.

@Override
protected JobResult processSubmitJobWithType(JobClient jobClient) {
    try {
        return KerberosUtils.login(sparkYarnConfig, () -> {
            EJobType jobType = jobClient.getJobType();
            JobResult jobResult = null;
            if (EJobType.MR.equals(jobType)) {
                jobResult = submitJobWithJar(jobClient);
            } else if (EJobType.SQL.equals(jobType)) {
                jobResult = submitSqlJob(jobClient);
            } else if (EJobType.PYTHON.equals(jobType)) {
                jobResult = submitPythonJob(jobClient);
            }
            return jobResult;
        }, yarnConf, true);
    } catch (Exception e) {
        logger.info("", e);
        return JobResult.createErrorResult("submit job get unknown error\n" + ExceptionUtil.getErrorMessage(e));
    }
}
Also used : JobResult(com.dtstack.taier.pluginapi.pojo.JobResult) EJobType(com.dtstack.taier.pluginapi.enums.EJobType) IOException(java.io.IOException) PluginDefineException(com.dtstack.taier.pluginapi.exception.PluginDefineException)

Example 2 with EJobType

use of com.dtstack.taier.pluginapi.enums.EJobType in project Taier by DTStack.

the class AbstractRdbsClient method processSubmitJobWithType.

@Override
protected JobResult processSubmitJobWithType(JobClient jobClient) {
    EJobType jobType = jobClient.getJobType();
    JobResult jobResult = null;
    if (EJobType.MR.equals(jobType)) {
        jobResult = submitJobWithJar(jobClient);
    } else if (EJobType.SQL.equals(jobType)) {
        jobResult = submitSqlJob(jobClient);
    }
    return jobResult;
}
Also used : JobResult(com.dtstack.taier.pluginapi.pojo.JobResult) EJobType(com.dtstack.taier.pluginapi.enums.EJobType)

Example 3 with EJobType

use of com.dtstack.taier.pluginapi.enums.EJobType in project Taier by DTStack.

the class FlinkClient method processSubmitJobWithType.

@Override
protected JobResult processSubmitJobWithType(JobClient jobClient) {
    try {
        return KerberosUtils.login(flinkConfig, () -> {
            EJobType jobType = jobClient.getJobType();
            JobResult jobResult = null;
            if (EJobType.MR.equals(jobType)) {
                jobResult = submitJobWithJar(jobClient);
            } else if (EJobType.SQL.equals(jobType)) {
                jobResult = submitSqlJob(jobClient);
            } else if (EJobType.SYNC.equals(jobType)) {
                jobResult = submitSyncJob(jobClient);
            }
            if (jobResult != null) {
                logger.info("taskId: {}, job submit success, result: {}", jobClient.getJobId(), jobResult.toString());
            }
            return jobResult;
        }, hadoopConf.getYarnConfiguration());
    } catch (Exception e) {
        logger.error("taskId: {}, can not submit a job process SubmitJobWithType error: ", jobClient.getJobId(), e);
        return JobResult.createErrorResult(e);
    }
}
Also used : JobResult(com.dtstack.taier.pluginapi.pojo.JobResult) EJobType(com.dtstack.taier.pluginapi.enums.EJobType) IOException(java.io.IOException) PluginDefineException(com.dtstack.taier.pluginapi.exception.PluginDefineException) YarnException(org.apache.hadoop.yarn.exceptions.YarnException) MalformedURLException(java.net.MalformedURLException)

Aggregations

EJobType (com.dtstack.taier.pluginapi.enums.EJobType)3 JobResult (com.dtstack.taier.pluginapi.pojo.JobResult)3 PluginDefineException (com.dtstack.taier.pluginapi.exception.PluginDefineException)2 IOException (java.io.IOException)2 MalformedURLException (java.net.MalformedURLException)1 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)1