From 43d5a98fd7009365c63dcf59b5849c43565e3460 Mon Sep 17 00:00:00 2001 From: elisheva-qlogic Date: Fri, 18 Jan 2019 13:04:25 -0500 Subject: [PATCH 1/2] fixing some deprecation warnings --- .../data/v2/stub/mutaterows/MutateRowsAttemptCallable.java | 3 ++- .../com/google/cloud/bigtable/data/v2/it/env/Emulator.java | 2 +- .../src/main/java/com/google/cloud/ServiceOptions.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java index cb66f767d98f..77f85f4b28fb 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java @@ -185,7 +185,8 @@ public Void call() { // Handle RPC level errors by wrapping them in a MutateRowsException ApiFuture> catching = - ApiFutures.catching(innerFuture, Throwable.class, attemptFailedCallback); + ApiFutures.catching( + innerFuture, Throwable.class, attemptFailedCallback, MoreExecutors.directExecutor()); // Inspect the results and either propagate the success, or prepare to retry the failed // mutations diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java index d8e7b00b0c4f..8792dda60d64 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java +++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java @@ -175,7 +175,7 @@ private ManagedChannel createChannel(int port) { // NOTE: usePlaintext is currently @ExperimentalAPI. In grpc 1.11 it be became parameterless. // In 1.12 it should be stable. See https://github.com/grpc/grpc-java/issues/1772 for discussion return ManagedChannelBuilder.forAddress("localhost", port) - .usePlaintext(true) + .usePlaintext() .maxInboundMessageSize(256 * 1024 * 1024) .build(); } diff --git a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java index 141c99857da4..d08b14e71506 100644 --- a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java +++ b/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java @@ -349,7 +349,8 @@ private static String getActiveGoogleCloudConfig(File configDir) { String activeGoogleCloudConfig = null; try { activeGoogleCloudConfig = - Files.readFirstLine(new File(configDir, "active_config"), Charset.defaultCharset()); + Files.asCharSource(new File(configDir, "active_config"), Charset.defaultCharset()) + .readFirstLine(); } catch (IOException ex) { // ignore } From 86463b20d1081ad7c4f8b368d16543a27686a525 Mon Sep 17 00:00:00 2001 From: elisheva-qlogic Date: Fri, 18 Jan 2019 13:04:57 -0500 Subject: [PATCH 2/2] updated comment --- .../java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java index 8792dda60d64..dca4efbc514e 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java +++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/env/Emulator.java @@ -172,8 +172,6 @@ private void waitForPort(int port) throws InterruptedException, TimeoutException } private ManagedChannel createChannel(int port) { - // NOTE: usePlaintext is currently @ExperimentalAPI. In grpc 1.11 it be became parameterless. - // In 1.12 it should be stable. See https://github.com/grpc/grpc-java/issues/1772 for discussion return ManagedChannelBuilder.forAddress("localhost", port) .usePlaintext() .maxInboundMessageSize(256 * 1024 * 1024)