use of com.dtstack.taier.pluginapi.pojo.ParamAction in project Taier by DTStack.
the class PerJobClientFactory method getClusterClient.
@Override
public ClusterClient getClusterClient(JobIdentifier jobIdentifier) {
String applicationId = jobIdentifier.getApplicationId();
String jobId = jobIdentifier.getJobId();
ClusterClient clusterClient = null;
try {
clusterClient = KerberosUtils.login(flinkConfig, () -> {
try {
return perJobClientCache.get(applicationId, () -> {
ParamAction action = new ParamAction();
action.setJobId(jobId);
action.setName("jobId-" + jobId);
action.setTaskType(EJobType.SQL.getType());
action.setComputeType(ComputeType.STREAM.getType());
action.setTenantId(-1L);
String taskParams = "flinkTaskRunMode=per_job";
action.setTaskParams(taskParams);
JobClient jobClient = new JobClient(action);
try (YarnClusterDescriptor perJobYarnClusterDescriptor = this.createPerJobClusterDescriptor(jobClient)) {
return perJobYarnClusterDescriptor.retrieve(ConverterUtils.toApplicationId(applicationId)).getClusterClient();
}
});
} catch (ExecutionException e) {
throw new PluginDefineException(e);
}
}, flinkClientBuilder.getYarnConf());
} catch (Exception e) {
LOG.error("job[{}] get perJobClient exception:{}", jobId, e);
throw new PluginDefineException(e);
}
return clusterClient;
}
Aggregations