use of io.cdap.cdap.runtime.spi.runtimejob.DataprocClusterInfo in project cdap by caskdata.
the class AbstractDataprocProvisioner method getRuntimeJobManager.
/**
* Provides implementation of {@link RuntimeJobManager}.
*/
@Override
public Optional<RuntimeJobManager> getRuntimeJobManager(ProvisionerContext context) {
Map<String, String> properties = createContextProperties(context);
DataprocConf conf = DataprocConf.create(properties);
// runtime job manager for job launch.
if (!conf.isRuntimeJobManagerEnabled()) {
return Optional.empty();
}
try {
String clusterName = getClusterName(context);
String projectId = conf.getProjectId();
String region = conf.getRegion();
String bucket = properties.get(BUCKET);
Map<String, String> systemLabels = getSystemLabels();
return Optional.of(new DataprocRuntimeJobManager(new DataprocClusterInfo(context, clusterName, conf.getDataprocCredentials(), getRootUrl(conf), projectId, region, bucket, systemLabels)));
} catch (Exception e) {
throw new RuntimeException("Error while getting credentials for dataproc. ", e);
}
}
Aggregations