use of com.dtstack.taier.pluginapi.enums.ComputeType in project Taier by DTStack.
the class FlinkResource method getComputeResourceType.
@Override
public ComputeResourceType getComputeResourceType(JobClient jobClient) {
long tenantId = jobClient.getTenantId();
EComponentType componentType = resourceComponents.computeIfAbsent(tenantId, e -> getResourceEComponentType(jobClient));
Properties properties = jobClient.getConfProperties();
ComputeType computeType = jobClient.getComputeType();
String modeStr = properties.getProperty(FLINK_TASK_RUN_MODE_KEY);
if (EComponentType.FLINK.getTypeCode().equals(componentType.getTypeCode())) {
// flink on standalone
return ComputeResourceType.FlinkOnStandalone;
} else if (EComponentType.YARN.getTypeCode().equals(componentType.getTypeCode())) {
if (StringUtils.isEmpty(modeStr)) {
if (ComputeType.STREAM == computeType) {
return ComputeResourceType.Yarn;
} else {
return ComputeResourceType.FlinkYarnSession;
}
}
if (SESSION.equalsIgnoreCase(modeStr)) {
return ComputeResourceType.FlinkYarnSession;
} else if (PER_JOB.equalsIgnoreCase(modeStr)) {
return ComputeResourceType.Yarn;
} else if (STANDALONE.equals(modeStr)) {
return ComputeResourceType.FlinkOnStandalone;
}
}
throw new RdosDefineException("not support mode: " + modeStr);
}
Aggregations