diff --git a/google-cloud-bigquerystorage/clirr-ignored-differences.xml b/google-cloud-bigquerystorage/clirr-ignored-differences.xml index c5f0600724..c55b8a691c 100644 --- a/google-cloud-bigquerystorage/clirr-ignored-differences.xml +++ b/google-cloud-bigquerystorage/clirr-ignored-differences.xml @@ -108,4 +108,38 @@ com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool ConnectionWorkerPool(long, long, java.time.Duration, com.google.api.gax.batching.FlowController$LimitExceededBehavior, java.lang.String, com.google.cloud.bigquery.storage.v1.BigQueryWriteClient, boolean) + + 1001 + com/google/cloud/bigquery/storage/v1/ConnectionWorker + + + 7009 + com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool + ConnectionWorkerPool(long, long, java.time.Duration, com.google.api.gax.batching.FlowController$LimitExceededBehavior, java.lang.String, com.google.cloud.bigquery.storage.v1.BigQueryWriteClient, boolean) + + + 7009 + com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool + com.google.api.core.ApiFuture append(com.google.cloud.bigquery.storage.v1.StreamWriter, com.google.cloud.bigquery.storage.v1.ProtoRows) + + + 7009 + com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool + com.google.api.core.ApiFuture append(com.google.cloud.bigquery.storage.v1.StreamWriter, com.google.cloud.bigquery.storage.v1.ProtoRows, long) + + + 7009 + com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool + void close(com.google.cloud.bigquery.storage.v1.StreamWriter) + + + 7009 + com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool + void enableTestingLogic() + + + 7009 + com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool + long getInflightWaitSeconds(com.google.cloud.bigquery.storage.v1.StreamWriter) + diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java index 69aef0527c..573bc0c055 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java @@ -58,7 +58,7 @@ * *

TODO: support updated schema */ -public class ConnectionWorker implements AutoCloseable { +class ConnectionWorker implements AutoCloseable { private static final Logger log = Logger.getLogger(StreamWriter.class.getName()); private Lock lock; diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java index 7bcb358eea..0e6b5eab3a 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java @@ -21,6 +21,7 @@ import com.google.auto.value.AutoValue; import com.google.cloud.bigquery.storage.v1.ConnectionWorker.Load; import com.google.cloud.bigquery.storage.v1.ConnectionWorker.TableSchemaAndTimestamp; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.base.Stopwatch; import com.google.common.collect.ImmutableList; @@ -192,7 +193,7 @@ public abstract static class Builder { /** Static setting for connection pool. */ private static Settings settings = Settings.builder().build(); - public ConnectionWorkerPool( + ConnectionWorkerPool( long maxInflightRequests, long maxInflightBytes, java.time.Duration maxRetryDuration, @@ -218,13 +219,12 @@ public static void setOptions(Settings settings) { } /** Distributes the writing of a message to an underlying connection. */ - public ApiFuture append(StreamWriter streamWriter, ProtoRows rows) { + ApiFuture append(StreamWriter streamWriter, ProtoRows rows) { return append(streamWriter, rows, -1); } /** Distributes the writing of a message to an underlying connection. */ - public ApiFuture append( - StreamWriter streamWriter, ProtoRows rows, long offset) { + ApiFuture append(StreamWriter streamWriter, ProtoRows rows, long offset) { // We are in multiplexing mode after entering the following logic. ConnectionWorker connectionWorker; lock.lock(); @@ -371,7 +371,7 @@ private ConnectionWorker createConnectionWorker(String streamName, ProtoSchema w *

The corresponding worker is not closed until there is no stream reference is targeting to * that worker. */ - public void close(StreamWriter streamWriter) { + void close(StreamWriter streamWriter) { lock.lock(); try { streamWriterToConnection.remove(streamWriter); @@ -403,7 +403,7 @@ public void close(StreamWriter streamWriter) { } /** Fetch the wait seconds from corresponding worker. */ - public long getInflightWaitSeconds(StreamWriter streamWriter) { + long getInflightWaitSeconds(StreamWriter streamWriter) { lock.lock(); try { ConnectionWorker connectionWorker = streamWriterToConnection.get(streamWriter); @@ -422,7 +422,8 @@ TableSchemaAndTimestamp getUpdatedSchema(StreamWriter streamWriter) { } /** Enable Test related logic. */ - public static void enableTestingLogic() { + @VisibleForTesting + static void enableTestingLogic() { enableTesting = true; }