diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriter.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriter.java index c078fa41e3..dda66bbe6f 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriter.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriter.java @@ -146,7 +146,6 @@ private StreamWriter(Builder builder) stubSettings = BigQueryWriteSettings.newBuilder() .setCredentialsProvider(builder.credentialsProvider) - .setExecutorProvider(builder.executorProvider) .setTransportChannelProvider(builder.channelProvider) .setEndpoint(builder.endpoint) .build(); @@ -250,7 +249,6 @@ public ApiFuture append(AppendRowsRequest message) { * @throws IOException */ public void refreshAppend() throws IOException, InterruptedException { - LOG.info("Establish a write connection."); synchronized (this) { if (shutdown.get()) { LOG.warning("Cannot refresh on a already shutdown writer."); @@ -258,7 +256,7 @@ public void refreshAppend() throws IOException, InterruptedException { } // There could be a moment, stub is not yet initialized. if (clientStream != null) { - LOG.info("Closing the stream"); + LOG.info("Closing the stream " + streamName); clientStream.closeSend(); } messagesBatch.resetAttachSchema(); diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriterTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriterTest.java index 7e8babb2dd..b211d6045d 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriterTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/StreamWriterTest.java @@ -516,7 +516,7 @@ public void testStreamReconnectionExceedRetry() throws Exception { StatusRuntimeException transientError = new StatusRuntimeException(Status.UNAVAILABLE); testBigQueryWrite.addException(transientError); testBigQueryWrite.addException(transientError); - ApiFuture future3 = sendTestMessage(writer, new String[] {"m3"}); + ApiFuture future3 = sendTestMessage(writer, new String[] {"toomanyretry"}); try { future3.get(); Assert.fail("This should fail."); @@ -821,12 +821,11 @@ public void testBuilderInvalidArguments() { @Test public void testAwaitTermination() throws Exception { - StreamWriter writer = - getTestStreamWriterBuilder().setExecutorProvider(SINGLE_THREAD_EXECUTOR).build(); + StreamWriter writer = getTestStreamWriterBuilder().build(); testBigQueryWrite.addResponse(AppendRowsResponse.newBuilder().build()); ApiFuture appendFuture1 = sendTestMessage(writer, new String[] {"A"}); writer.shutdown(); - assertTrue(writer.awaitTermination(2, TimeUnit.MINUTES)); + assertTrue(writer.awaitTermination(1, TimeUnit.MINUTES)); } @Test