Search in sources :

Example 56 with Cluster

use of com.google.container.v1beta1.Cluster in project java-dataproc by googleapis.

the class SubmitHadoopFsJobTest method setUp.

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException {
    bout = new ByteArrayOutputStream();
    System.setOut(new PrintStream(bout));
    ClusterControllerSettings clusterControllerSettings = ClusterControllerSettings.newBuilder().setEndpoint(ENDPOINT).build();
    try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create(clusterControllerSettings)) {
        // Create the Dataproc cluster.
        Cluster cluster = Cluster.newBuilder().setClusterName(CLUSTER_NAME).build();
        OperationFuture<Cluster, ClusterOperationMetadata> createClusterAsyncRequest = clusterControllerClient.createClusterAsync(PROJECT_ID, REGION, cluster);
        createClusterAsyncRequest.get();
    }
}
Also used : PrintStream(java.io.PrintStream) ClusterOperationMetadata(com.google.cloud.dataproc.v1.ClusterOperationMetadata) ClusterControllerClient(com.google.cloud.dataproc.v1.ClusterControllerClient) Cluster(com.google.cloud.dataproc.v1.Cluster) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ClusterControllerSettings(com.google.cloud.dataproc.v1.ClusterControllerSettings) Before(org.junit.Before)

Example 57 with Cluster

use of com.google.container.v1beta1.Cluster in project java-dataproc by googleapis.

the class SubmitJobTest method setUp.

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException {
    bout = new ByteArrayOutputStream();
    System.setOut(new PrintStream(bout));
    ClusterControllerSettings clusterControllerSettings = ClusterControllerSettings.newBuilder().setEndpoint(ENDPOINT).build();
    try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create(clusterControllerSettings)) {
        // Create the Dataproc cluster.
        Cluster cluster = Cluster.newBuilder().setClusterName(CLUSTER_NAME).build();
        OperationFuture<Cluster, ClusterOperationMetadata> createClusterAsyncRequest = clusterControllerClient.createClusterAsync(PROJECT_ID, REGION, cluster);
        createClusterAsyncRequest.get();
    }
}
Also used : PrintStream(java.io.PrintStream) ClusterOperationMetadata(com.google.cloud.dataproc.v1.ClusterOperationMetadata) ClusterControllerClient(com.google.cloud.dataproc.v1.ClusterControllerClient) Cluster(com.google.cloud.dataproc.v1.Cluster) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ClusterControllerSettings(com.google.cloud.dataproc.v1.ClusterControllerSettings) Before(org.junit.Before)

Aggregations

Test (org.junit.Test)38 AbstractMessage (com.google.protobuf.AbstractMessage)17 Cluster (com.google.bigtable.admin.v2.Cluster)16 Cluster (com.google.cloud.dataproc.v1.Cluster)15 ExecutionException (java.util.concurrent.ExecutionException)15 ArrayList (java.util.ArrayList)14 ClusterOperationMetadata (com.google.cloud.dataproc.v1.ClusterOperationMetadata)12 Cluster (com.google.container.v1.Cluster)12 HashMap (java.util.HashMap)11 ClusterControllerClient (com.google.cloud.dataproc.v1.ClusterControllerClient)10 ClusterControllerSettings (com.google.cloud.dataproc.v1.ClusterControllerSettings)10 Operation (com.google.longrunning.Operation)10 Cluster (io.envoyproxy.envoy.config.cluster.v3.Cluster)10 InvalidArgumentException (com.google.api.gax.rpc.InvalidArgumentException)9 ClusterConfig (com.google.cloud.dataproc.v1.ClusterConfig)7 InstanceGroupConfig (com.google.cloud.dataproc.v1.InstanceGroupConfig)7 ByteString (com.google.protobuf.ByteString)7 StatusRuntimeException (io.grpc.StatusRuntimeException)7 ApiException (com.google.api.gax.rpc.ApiException)6 FieldMask (com.google.protobuf.FieldMask)6