From 4142b4204f214790f0a0fbaac5becebb74fb2773 Mon Sep 17 00:00:00 2001 From: elisheva-qlogic Date: Mon, 29 Oct 2018 14:14:14 -0400 Subject: [PATCH] fixed_whitespace --- .../bigtable/data/v2/BigtableDataClient.java | 41 ++++++++++--------- .../data/v2/BigtableDataClientTest.java | 9 ++-- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java index 6264b004d09a..e36e7900057b 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java @@ -157,8 +157,8 @@ public static BigtableDataClient create(BigtableDataSettings settings) throws IO * } * } * } catch(ApiException e) { - * e.printStackTrace(); - * } + * e.printStackTrace(); + * } * } * * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs @@ -187,8 +187,8 @@ public Row readRow(String tableId, ByteString rowKey) { * } * } * } catch(ApiException e) { - * e.printStackTrace(); - * } + * e.printStackTrace(); + * } * } * * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs @@ -219,7 +219,9 @@ public Row readRow(String tableId, String rowKey) { * } * } * public void onSuccess(Row result) { - * System.out.println("Got row: " + result); + * if (result != null) { + * System.out.println("Got row: " + result); + * } * } * }, MoreExecutors.directExecutor()); * } @@ -251,7 +253,9 @@ public ApiFuture readRowAsync(String tableId, String rowKey) { * } * } * public void onSuccess(Row row) { - * System.out.println("Got row: " + row); + * if (result != null) { + * System.out.println("Got row: " + result); + * } * } * }, MoreExecutors.directExecutor()); * } @@ -452,8 +456,8 @@ public ServerStreamingCallable readRowsCallable(RowAdapter * * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs @@ -549,8 +553,8 @@ public UnaryCallable> sampleRowKeysCallable() { * * bigtableDataClient.mutateRow(mutation); * } catch(ApiException e) { - * e.printStackTrace(); - * } + * e.printStackTrace(); + * } * } * * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs @@ -663,11 +667,10 @@ public BulkMutationBatcher newBulkMutationBatcher() { * } * bigtableDataClient.bulkMutateRows(batch); * } catch(ApiException e) { - * e.printStackTrace(); - * } - * catch(MutateRowsException e) { - * e.printStackTrace(); - * } + * e.printStackTrace(); + * } catch(MutateRowsException e) { + * e.printStackTrace(); + * } * } * * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs @@ -753,8 +756,8 @@ public UnaryCallable bulkMutationCallable() { * * Boolean result = bigtableDataClient.checkAndMutateRow(mutation); * } catch(ApiException e) { - * e.printStackTrace(); - * } + * e.printStackTrace(); + * } * } * * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs @@ -849,8 +852,8 @@ public UnaryCallable checkAndMutateRowCallable( * * Row success = bigtableDataClient.readModifyWriteRow(mutation); * } catch(ApiException e) { - * e.printStackTrace(); - * } + * e.printStackTrace(); + * } * } * * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java index 7dc62f48040d..ffaebcdab63d 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java +++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java @@ -139,7 +139,8 @@ public void proxyReadRowStrAsyncTest() { @Test public void readRowTest() { Mockito.when(mockReadRowsCallable.first().futureCall(any(Query.class))) - .thenReturn(ApiFutures.immediateFuture(Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList()))); + .thenReturn(ApiFutures.immediateFuture( + Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList()))); bigtableDataClient.readRow("fake-table", ByteString.copyFromUtf8("fake-row-key")); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class); @@ -160,7 +161,8 @@ public void readRowTest() { @Test public void readRowStrTest() { Mockito.when(mockReadRowsCallable.first().futureCall(any(Query.class))) - .thenReturn(ApiFutures.immediateFuture(Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList()))); + .thenReturn(ApiFutures.immediateFuture( + Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList()))); bigtableDataClient.readRow("fake-table", "fake-row-key"); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Query.class); @@ -209,7 +211,8 @@ public void proxySampleRowKeysTest() { @Test public void sampleRowKeysTest() { - Mockito.when(mockSampleRowKeysCallable.futureCall(any(String.class))).thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); + Mockito.when(mockSampleRowKeysCallable.futureCall(any(String.class))) + .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); bigtableDataClient.sampleRowKeys("fake-table"); Mockito.verify(mockSampleRowKeysCallable).futureCall("fake-table"); }