Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: small updates to dataproc sample, test and pom #1738

Merged
merged 17 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Fixed linting errors
  • Loading branch information
bradmiro committed Nov 15, 2019
commit 85aff43ab90f9770d409c28b35e658ec56a36c86
1 change: 0 additions & 1 deletion dataproc/src/main/java/CreateCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

// [START create_cluster]
import com.google.api.core.ApiFuture;
import com.google.cloud.dataproc.v1.Cluster;
import com.google.cloud.dataproc.v1.ClusterConfig;
import com.google.cloud.dataproc.v1.ClusterControllerClient;
Expand Down
11 changes: 5 additions & 6 deletions dataproc/src/test/java/CreateClusterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.dataproc.v1.ClusterControllerClient;
import com.google.cloud.dataproc.v1.ClusterControllerSettings;
import com.google.cloud.dataproc.v1.ClusterOperationMetadata;
import com.google.protobuf.Empty;
import java.io.ByteArrayOutputStream;
Expand All @@ -41,7 +40,7 @@ public class CreateClusterTest {
private static final String BASE_CLUSTER_NAME = "test-cluster";
private static final String REGION = "us-central1";

private static String projectId = System.getenv("GOOGLE_CLOUD_PROJECT");;
private static String projectId = System.getenv("GOOGLE_CLOUD_PROJECT");
private String clusterName;
private ByteArrayOutputStream bout;

Expand All @@ -59,7 +58,7 @@ public static void checkRequirements() {
}

@Before
public void setUp(){
public void setUp() {
clusterName = String.format("%s-%s", BASE_CLUSTER_NAME, UUID.randomUUID().toString());

bout = new ByteArrayOutputStream();
Expand All @@ -75,11 +74,11 @@ public void createClusterTest() throws Exception {
}

@After
public void tearDown() throws IOException {
public void tearDown() {
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient
.create()) {
OperationFuture<Empty, ClusterOperationMetadata> deleteClusterAsyncRequest = clusterControllerClient
.deleteClusterAsync(projectId, REGION, clusterName);
OperationFuture<Empty, ClusterOperationMetadata> deleteClusterAsyncRequest =
clusterControllerClient.deleteClusterAsync(projectId, REGION, clusterName);
deleteClusterAsyncRequest.get();

} catch (IOException | InterruptedException | ExecutionException e) {
Expand Down