Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit 694a870

Browse files
feat: minor tune after offline testing (#1807)
* feat: Split writer into connection worker and wrapper, this is a prerequisite for multiplexing client * feat: add connection worker pool skeleton, used for multiplexing client * feat: add Load api for connection worker for multiplexing client * feat: add multiplexing support to connection worker. We will treat every new stream name as a switch of destinationt * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: port the multiplexing client core algorithm and basic tests also fixed a tiny bug inside fake bigquery write impl for getting thre response from offset * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: wire multiplexing connection pool to stream writer * feat: some fixes for multiplexing client * feat: fix some todos, and reject the mixed behavior of passed in client or not * feat: fix the bug that we may peek into the write_stream field but it's possible the proto schema does not contain this field * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: fix the bug that we may peek into the write_stream field but it's possible the proto schema does not contain this field Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 9791d69 commit 694a870

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,8 @@ public Load getLoad() {
735735
public abstract static class Load {
736736
// Consider the load on this worker to be overwhelmed when above some percentage of
737737
// in-flight bytes or in-flight requests count.
738-
private static double overwhelmedInflightCount = 0.5;
739-
private static double overwhelmedInflightBytes = 0.6;
738+
private static double overwhelmedInflightCount = 0.2;
739+
private static double overwhelmedInflightBytes = 0.2;
740740

741741
// Number of in-flight requests bytes in the worker.
742742
abstract long inFlightRequestsBytes();

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public abstract static class Settings {
163163
public static Builder builder() {
164164
return new AutoValue_ConnectionWorkerPool_Settings.Builder()
165165
.setMinConnectionsPerRegion(2)
166-
.setMaxConnectionsPerRegion(10);
166+
.setMaxConnectionsPerRegion(20);
167167
}
168168

169169
/** Builder for the options to config {@link ConnectionWorkerPool}. */

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,16 @@ private StreamWriter(Builder builder) throws IOException {
213213
String fetchedLocation = writeStream.getLocation();
214214
log.info(
215215
String.format(
216-
"Fethed location %s for stream name %s", fetchedLocation, streamName));
216+
"Fethed location %s for stream name %s, extracted project and dataset name: %s\"",
217+
fetchedLocation, streamName, datasetAndProjectName));
217218
return fetchedLocation;
218219
});
219220
if (location.isEmpty()) {
220221
throw new IllegalStateException(
221222
String.format(
222223
"The location is empty for both user passed in value and looked up value for "
223-
+ "stream: %s",
224-
streamName));
224+
+ "stream: %s, extracted project and dataset name: %s",
225+
streamName, datasetAndProjectName));
225226
}
226227
}
227228
this.location = location;

google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPoolTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public void setUp() throws Exception {
6868
.setCredentialsProvider(NoCredentialsProvider.create())
6969
.setTransportChannelProvider(serviceHelper.createChannelProvider())
7070
.build());
71+
ConnectionWorker.Load.setOverwhelmedCountsThreshold(0.5);
72+
ConnectionWorker.Load.setOverwhelmedBytesThreshold(0.6);
7173
}
7274

7375
@Test

0 commit comments

Comments
 (0)