Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fb5ddd7
test branch PR
Feb 25, 2022
f75638e
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 25, 2022
0175fa5
test branch reset
Feb 25, 2022
8dd726d
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Feb 25, 2022
bc494a1
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 25, 2022
0023cc5
CreateCluster debug
Mar 3, 2022
01344d9
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Mar 3, 2022
7e66f6d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 3, 2022
a6b39e1
Merge branch 'main' into fix_dataproc_samples
loferris Mar 24, 2022
e6d01b6
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 24, 2022
81ac874
create cluster test update
Mar 24, 2022
3c4bf62
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Mar 24, 2022
e7ee4f0
troubleshooting async request return types
Mar 24, 2022
3873d09
rewrite async setup
Mar 24, 2022
62f1233
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 24, 2022
0deb573
updating cleanup method for async requests
Mar 24, 2022
984200d
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Mar 24, 2022
4ef4353
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 24, 2022
00995ab
fixing compile error
Mar 24, 2022
b67b80b
resolving merge conflicts with remote
Mar 24, 2022
68686fd
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 24, 2022
d125787
fixed imports
Mar 24, 2022
fa28c69
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Mar 24, 2022
d28f5c4
updating both async methods to same alternative
Mar 24, 2022
7c02302
troubleshooting compile
Mar 24, 2022
20b4ede
troubleshooting compile errors
Mar 25, 2022
d431581
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 25, 2022
e09d680
troubleshooting compile errors
Mar 25, 2022
dd22ce0
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Mar 25, 2022
7df7c16
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 25, 2022
f0decef
testing ClusterConfig
Mar 28, 2022
36fd368
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Mar 28, 2022
c1e2ad1
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 28, 2022
c46efb0
fixing imports
Mar 28, 2022
f9d7072
Merge branch 'fix_dataproc_samples' of github.com:googleapis/java-dat…
Mar 28, 2022
ef67499
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 28, 2022
ccd3a2d
adding ClusterConfig to Hadoop tests
Mar 28, 2022
4dc5591
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 28, 2022
b1beeef
fixing imports
Mar 28, 2022
547b0f6
resolve merge conflicts
Mar 28, 2022
c7931da
fixing imports
Mar 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions google-cloud-dataproc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-dataproc-v1</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
18 changes: 9 additions & 9 deletions samples/snippets/src/test/java/CreateClusterTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,21 +40,22 @@ public class CreateClusterTest {
private static final String CLUSTER_NAME =
String.format("java-cc-test-%s", UUID.randomUUID().toString());
private static final String REGION = "us-central1";
// private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String PROJECT_ID = "gcloud-devel";
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
private ByteArrayOutputStream bout;

private static void requireEnv(String varName) {
assertNotNull(
String.format("Environment variable '%s' is required to perform these tests.", varName),
System.getenv(varName));
}

/*
@BeforeClass
public static void checkRequirements() {
requireEnv("GOOGLE_APPLICATION_CREDENTIALS");
requireEnv("GOOGLE_CLOUD_PROJECT");
}*/
@BeforeClass
public static void checkRequirements() {
requireEnv("GOOGLE_APPLICATION_CREDENTIALS");
requireEnv("GOOGLE_CLOUD_PROJECT");
}
*/

@Before
public void setUp() {
Expand All @@ -66,7 +67,6 @@ public void setUp() {
public void createClusterTest() throws IOException, InterruptedException {
CreateCluster.createCluster(PROJECT_ID, REGION, CLUSTER_NAME);
String output = bout.toString();

assertThat(output, CoreMatchers.containsString(CLUSTER_NAME));
}

Expand Down
23 changes: 21 additions & 2 deletions samples/snippets/src/test/java/SubmitHadoopFsJobTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,9 +19,11 @@

import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.dataproc.v1.Cluster;
import com.google.cloud.dataproc.v1.ClusterConfig;
import com.google.cloud.dataproc.v1.ClusterControllerClient;
import com.google.cloud.dataproc.v1.ClusterControllerSettings;
import com.google.cloud.dataproc.v1.ClusterOperationMetadata;
import com.google.cloud.dataproc.v1.InstanceGroupConfig;
import com.google.protobuf.Empty;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -70,8 +72,25 @@ public void setUp() throws IOException, ExecutionException, InterruptedException

try (ClusterControllerClient clusterControllerClient =
ClusterControllerClient.create(clusterControllerSettings)) {
// Configure the settings for our cluster.
InstanceGroupConfig masterConfig =
InstanceGroupConfig.newBuilder()
.setMachineTypeUri("n1-standard-2")
.setNumInstances(1)
.build();
InstanceGroupConfig workerConfig =
InstanceGroupConfig.newBuilder()
.setMachineTypeUri("n1-standard-2")
.setNumInstances(2)
.build();
ClusterConfig clusterConfig =
ClusterConfig.newBuilder()
.setMasterConfig(masterConfig)
.setWorkerConfig(workerConfig)
.build();
// Create the Dataproc cluster.
Cluster cluster = Cluster.newBuilder().setClusterName(CLUSTER_NAME).build();
Cluster cluster =
Cluster.newBuilder().setClusterName(CLUSTER_NAME).setConfig(clusterConfig).build();
OperationFuture<Cluster, ClusterOperationMetadata> createClusterAsyncRequest =
clusterControllerClient.createClusterAsync(PROJECT_ID, REGION, cluster);
createClusterAsyncRequest.get();
Expand Down
21 changes: 20 additions & 1 deletion samples/snippets/src/test/java/SubmitJobTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@

import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.dataproc.v1.Cluster;
import com.google.cloud.dataproc.v1.ClusterConfig;
import com.google.cloud.dataproc.v1.ClusterControllerClient;
import com.google.cloud.dataproc.v1.ClusterControllerSettings;
import com.google.cloud.dataproc.v1.ClusterOperationMetadata;
import com.google.cloud.dataproc.v1.InstanceGroupConfig;
import com.google.protobuf.Empty;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -69,8 +71,25 @@ public void setUp() throws IOException, ExecutionException, InterruptedException

try (ClusterControllerClient clusterControllerClient =
ClusterControllerClient.create(clusterControllerSettings)) {
// Configure the settings for our cluster.
InstanceGroupConfig masterConfig =
InstanceGroupConfig.newBuilder()
.setMachineTypeUri("n1-standard-2")
.setNumInstances(1)
.build();
InstanceGroupConfig workerConfig =
InstanceGroupConfig.newBuilder()
.setMachineTypeUri("n1-standard-2")
.setNumInstances(2)
.build();
ClusterConfig clusterConfig =
ClusterConfig.newBuilder()
.setMasterConfig(masterConfig)
.setWorkerConfig(workerConfig)
.build();
// Create the Dataproc cluster.
Cluster cluster = Cluster.newBuilder().setClusterName(CLUSTER_NAME).build();
Cluster cluster =
Cluster.newBuilder().setClusterName(CLUSTER_NAME).setConfig(clusterConfig).build();
OperationFuture<Cluster, ClusterOperationMetadata> createClusterAsyncRequest =
clusterControllerClient.createClusterAsync(PROJECT_ID, REGION, cluster);
createClusterAsyncRequest.get();
Expand Down