use of com.google.cloud.dataproc.v1.ClusterControllerSettings in project cdap by caskdata.
the class DataprocClient method getClusterControllerClient.
/*
* Using the input Google Credentials retrieve the Dataproc Cluster controller client
*/
private static ClusterControllerClient getClusterControllerClient(DataprocConf conf) throws IOException {
CredentialsProvider credentialsProvider = FixedCredentialsProvider.create(conf.getDataprocCredentials());
String rootUrl = Optional.ofNullable(conf.getRootUrl()).orElse(ClusterControllerSettings.getDefaultEndpoint());
String regionalEndpoint = conf.getRegion() + "-" + rootUrl;
ClusterControllerSettings controllerSettings = ClusterControllerSettings.newBuilder().setCredentialsProvider(credentialsProvider).setEndpoint(regionalEndpoint).build();
return ClusterControllerClient.create(controllerSettings);
}
Aggregations