Skip to content

Commit cfc8169

Browse files
committed
Merge branch 'eef' of github.com:kinsaurralde/java-spanner into eef
2 parents 0350d8f + bd2c2e5 commit cfc8169

File tree

29 files changed

+2147
-115
lines changed

29 files changed

+2147
-115
lines changed

.github/release-please.yml

Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,26 @@ releaseType: java-yoshi
22
bumpMinorPreMajor: true
33
handleGHRelease: true
44
branches:
5-
- branch: 3.3.x
6-
releaseType: java-yoshi
7-
bumpMinorPreMajor: true
8-
handleGHRelease: true
9-
- branch: 4.0.x
10-
releaseType: java-yoshi
11-
bumpMinorPreMajor: true
12-
handleGHRelease: true
13-
- branch: 5.2.x
14-
releaseType: java-yoshi
15-
bumpMinorPreMajor: true
16-
handleGHRelease: true
17-
- releaseType: java-lts
18-
bumpMinorPreMajor: true
19-
handleGHRelease: true
20-
branch: 6.4.4-sp
21-
- releaseType: java-backport
22-
bumpMinorPreMajor: true
23-
handleGHRelease: true
24-
branch: 6.14.x
25-
- releaseType: java-yoshi
26-
bumpMinorPreMajor: true
27-
handleGHRelease: true
28-
branch: 6.23.x
29-
- releaseType: java-yoshi
30-
bumpMinorPreMajor: true
31-
handleGHRelease: true
32-
branch: 6.33.x
33-
- releaseType: java-backport
34-
bumpMinorPreMajor: true
35-
handleGHRelease: true
36-
branch: 6.55.x
37-
- releaseType: java-backport
38-
bumpMinorPreMajor: true
39-
handleGHRelease: true
40-
branch: 6.67.x
41-
- releaseType: java-backport
42-
bumpMinorPreMajor: true
43-
handleGHRelease: true
44-
branch: 6.66.x
45-
- releaseType: java-backport
46-
bumpMinorPreMajor: true
47-
handleGHRelease: true
48-
branch: 6.88.x
49-
- releaseType: java-backport
50-
bumpMinorPreMajor: true
51-
handleGHRelease: true
52-
branch: 6.96.x
53-
- releaseType: java-backport
54-
bumpMinorPreMajor: true
55-
handleGHRelease: true
56-
branch: 6.95.x
57-
- releaseType: java-yoshi
58-
bumpMinorPreMajor: true
59-
handleGHRelease: true
60-
branch: protobuf-4.x-rc
61-
manifest: true
5+
- branch: 3.3.x
6+
- branch: 4.0.x
7+
- branch: 5.2.x
8+
- branch: 6.4.4-sp
9+
releaseType: java-lts
10+
- branch: 6.14.x
11+
releaseType: java-backport
12+
- branch: 6.23.x
13+
- branch: 6.33.x
14+
- branch: 6.55.x
15+
releaseType: java-backport
16+
- branch: 6.67.x
17+
releaseType: java-backport
18+
- branch: 6.66.x
19+
releaseType: java-backport
20+
- branch: 6.88.x
21+
releaseType: java-backport
22+
- branch: 6.96.x
23+
releaseType: java-backport
24+
- branch: 6.95.x
25+
releaseType: java-backport
26+
- branch: protobuf-4.x-rc
27+
manifest: true

.github/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40-
- uses: googleapis/sdk-platform-java/.github/scripts@v2.64.2
40+
- uses: googleapis/sdk-platform-java/.github/scripts@v2.65.1
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}

.github/workflows/unmanaged_dependency_check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
# repository
1818
.kokoro/build.sh
1919
- name: Unmanaged dependency check
20-
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.54.2
20+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.55.1
2121
with:
2222
bom-path: google-cloud-spanner-bom/pom.xml

benchmarks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>com.google.cloud</groupId>
2626
<artifactId>google-cloud-spanner-parent</artifactId>
27-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
27+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
2828
</parent>
2929

3030
<properties>

google-cloud-spanner-bom/pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-spanner-bom</artifactId>
6-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
6+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
77
<packaging>pom</packaging>
88
<parent>
99
<groupId>com.google.cloud</groupId>
1010
<artifactId>sdk-platform-java-config</artifactId>
11-
<version>3.54.2</version>
11+
<version>3.55.1</version>
1212
</parent>
1313

1414
<name>Google Cloud Spanner BOM</name>
@@ -53,43 +53,43 @@
5353
<dependency>
5454
<groupId>com.google.cloud</groupId>
5555
<artifactId>google-cloud-spanner</artifactId>
56-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
56+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
5757
</dependency>
5858
<dependency>
5959
<groupId>com.google.cloud</groupId>
6060
<artifactId>google-cloud-spanner</artifactId>
6161
<type>test-jar</type>
62-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
62+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
6363
</dependency>
6464
<dependency>
6565
<groupId>com.google.api.grpc</groupId>
6666
<artifactId>grpc-google-cloud-spanner-v1</artifactId>
67-
<version>6.106.0</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
67+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
6868
</dependency>
6969
<dependency>
7070
<groupId>com.google.api.grpc</groupId>
7171
<artifactId>grpc-google-cloud-spanner-admin-instance-v1</artifactId>
72-
<version>6.106.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
72+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
7373
</dependency>
7474
<dependency>
7575
<groupId>com.google.api.grpc</groupId>
7676
<artifactId>grpc-google-cloud-spanner-admin-database-v1</artifactId>
77-
<version>6.106.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
77+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
7878
</dependency>
7979
<dependency>
8080
<groupId>com.google.api.grpc</groupId>
8181
<artifactId>proto-google-cloud-spanner-admin-instance-v1</artifactId>
82-
<version>6.106.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
82+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
8383
</dependency>
8484
<dependency>
8585
<groupId>com.google.api.grpc</groupId>
8686
<artifactId>proto-google-cloud-spanner-v1</artifactId>
87-
<version>6.106.0</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
87+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
8888
</dependency>
8989
<dependency>
9090
<groupId>com.google.api.grpc</groupId>
9191
<artifactId>proto-google-cloud-spanner-admin-database-v1</artifactId>
92-
<version>6.106.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
92+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
9393
</dependency>
9494
</dependencies>
9595
</dependencyManagement>

google-cloud-spanner-executor/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.google.cloud</groupId>
77
<artifactId>google-cloud-spanner-executor</artifactId>
8-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner-executor:current} -->
8+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner-executor:current} -->
99
<packaging>jar</packaging>
1010
<name>Google Cloud Spanner Executor</name>
1111

1212
<parent>
1313
<groupId>com.google.cloud</groupId>
1414
<artifactId>google-cloud-spanner-parent</artifactId>
15-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
15+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
1616
</parent>
1717

1818
<properties>
@@ -62,7 +62,6 @@
6262
<dependency>
6363
<groupId>com.google.cloud</groupId>
6464
<artifactId>grpc-gcp</artifactId>
65-
<version>${grpc.gcp.version}</version>
6665
</dependency>
6766
<dependency>
6867
<groupId>io.opentelemetry.semconv</groupId>

google-cloud-spanner/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-spanner</artifactId>
6-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
6+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
77
<packaging>jar</packaging>
88
<name>Google Cloud Spanner</name>
99
<url>https://github.com/googleapis/java-spanner</url>
1010
<description>Java idiomatic client for Google Cloud Spanner.</description>
1111
<parent>
1212
<groupId>com.google.cloud</groupId>
1313
<artifactId>google-cloud-spanner-parent</artifactId>
14-
<version>6.106.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
14+
<version>6.106.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
1515
</parent>
1616
<properties>
1717
<site.installationModule>google-cloud-spanner</site.installationModule>
@@ -166,7 +166,6 @@
166166
<dependency>
167167
<groupId>com.google.cloud</groupId>
168168
<artifactId>grpc-gcp</artifactId>
169-
<version>${grpc.gcp.version}</version>
170169
</dependency>
171170
<dependency>
172171
<groupId>io.grpc</groupId>

google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@
2626
import static com.google.cloud.spanner.connection.ConnectionProperties.CREDENTIALS_URL;
2727
import static com.google.cloud.spanner.connection.ConnectionProperties.DATABASE_ROLE;
2828
import static com.google.cloud.spanner.connection.ConnectionProperties.DATA_BOOST_ENABLED;
29+
import static com.google.cloud.spanner.connection.ConnectionProperties.DCP_INITIAL_CHANNELS;
30+
import static com.google.cloud.spanner.connection.ConnectionProperties.DCP_MAX_CHANNELS;
31+
import static com.google.cloud.spanner.connection.ConnectionProperties.DCP_MIN_CHANNELS;
2932
import static com.google.cloud.spanner.connection.ConnectionProperties.DIALECT;
3033
import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_API_TRACING;
3134
import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_DIRECT_ACCESS;
35+
import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_DYNAMIC_CHANNEL_POOL;
3236
import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_END_TO_END_TRACING;
3337
import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_EXTENDED_TRACING;
3438
import static com.google.cloud.spanner.connection.ConnectionProperties.ENCODED_CREDENTIALS;
@@ -155,6 +159,10 @@ public class ConnectionOptions {
155159
static final Integer DEFAULT_MIN_SESSIONS = null;
156160
static final Integer DEFAULT_MAX_SESSIONS = null;
157161
static final Integer DEFAULT_NUM_CHANNELS = null;
162+
static final Boolean DEFAULT_ENABLE_DYNAMIC_CHANNEL_POOL = null;
163+
static final Integer DEFAULT_DCP_MIN_CHANNELS = null;
164+
static final Integer DEFAULT_DCP_MAX_CHANNELS = null;
165+
static final Integer DEFAULT_DCP_INITIAL_CHANNELS = null;
158166
static final String DEFAULT_ENDPOINT = null;
159167
static final String DEFAULT_CHANNEL_PROVIDER = null;
160168
static final String DEFAULT_DATABASE_ROLE = null;
@@ -252,6 +260,18 @@ public class ConnectionOptions {
252260
/** Name of the 'numChannels' connection property. */
253261
public static final String NUM_CHANNELS_PROPERTY_NAME = "numChannels";
254262

263+
/** Name of the 'enableDynamicChannelPool' connection property. */
264+
public static final String ENABLE_DYNAMIC_CHANNEL_POOL_PROPERTY_NAME = "enableDynamicChannelPool";
265+
266+
/** Name of the 'dcpMinChannels' connection property. */
267+
public static final String DCP_MIN_CHANNELS_PROPERTY_NAME = "dcpMinChannels";
268+
269+
/** Name of the 'dcpMaxChannels' connection property. */
270+
public static final String DCP_MAX_CHANNELS_PROPERTY_NAME = "dcpMaxChannels";
271+
272+
/** Name of the 'dcpInitialChannels' connection property. */
273+
public static final String DCP_INITIAL_CHANNELS_PROPERTY_NAME = "dcpInitialChannels";
274+
255275
/** Name of the 'endpoint' connection property. */
256276
public static final String ENDPOINT_PROPERTY_NAME = "endpoint";
257277

@@ -991,6 +1011,26 @@ public Integer getNumChannels() {
9911011
return getInitialConnectionPropertyValue(NUM_CHANNELS);
9921012
}
9931013

1014+
/** Whether dynamic channel pooling is enabled for this connection. */
1015+
public Boolean isEnableDynamicChannelPool() {
1016+
return getInitialConnectionPropertyValue(ENABLE_DYNAMIC_CHANNEL_POOL);
1017+
}
1018+
1019+
/** The minimum number of channels in the dynamic channel pool. */
1020+
public Integer getDcpMinChannels() {
1021+
return getInitialConnectionPropertyValue(DCP_MIN_CHANNELS);
1022+
}
1023+
1024+
/** The maximum number of channels in the dynamic channel pool. */
1025+
public Integer getDcpMaxChannels() {
1026+
return getInitialConnectionPropertyValue(DCP_MAX_CHANNELS);
1027+
}
1028+
1029+
/** The initial number of channels in the dynamic channel pool. */
1030+
public Integer getDcpInitialChannels() {
1031+
return getInitialConnectionPropertyValue(DCP_INITIAL_CHANNELS);
1032+
}
1033+
9941034
/** Calls the getChannelProvider() method from the supplied class. */
9951035
public TransportChannelProvider getChannelProvider() {
9961036
String channelProvider = getInitialConnectionPropertyValue(CHANNEL_PROVIDER);

google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
import static com.google.cloud.spanner.connection.ConnectionOptions.CREDENTIALS_PROVIDER_PROPERTY_NAME;
3030
import static com.google.cloud.spanner.connection.ConnectionOptions.DATABASE_ROLE_PROPERTY_NAME;
3131
import static com.google.cloud.spanner.connection.ConnectionOptions.DATA_BOOST_ENABLED_PROPERTY_NAME;
32+
import static com.google.cloud.spanner.connection.ConnectionOptions.DCP_INITIAL_CHANNELS_PROPERTY_NAME;
33+
import static com.google.cloud.spanner.connection.ConnectionOptions.DCP_MAX_CHANNELS_PROPERTY_NAME;
34+
import static com.google.cloud.spanner.connection.ConnectionOptions.DCP_MIN_CHANNELS_PROPERTY_NAME;
3235
import static com.google.cloud.spanner.connection.ConnectionOptions.DDL_IN_TRANSACTION_MODE_PROPERTY_NAME;
3336
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_AUTOCOMMIT;
3437
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_AUTO_BATCH_DML;
@@ -42,10 +45,14 @@
4245
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_CREDENTIALS;
4346
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DATABASE_ROLE;
4447
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DATA_BOOST_ENABLED;
48+
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DCP_INITIAL_CHANNELS;
49+
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DCP_MAX_CHANNELS;
50+
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DCP_MIN_CHANNELS;
4551
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DDL_IN_TRANSACTION_MODE;
4652
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DEFAULT_SEQUENCE_KIND;
4753
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE;
4854
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_ENABLE_API_TRACING;
55+
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_ENABLE_DYNAMIC_CHANNEL_POOL;
4956
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_ENABLE_END_TO_END_TRACING;
5057
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_ENABLE_EXTENDED_TRACING;
5158
import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_ENDPOINT;
@@ -75,6 +82,7 @@
7582
import static com.google.cloud.spanner.connection.ConnectionOptions.DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE_NAME;
7683
import static com.google.cloud.spanner.connection.ConnectionOptions.DIALECT_PROPERTY_NAME;
7784
import static com.google.cloud.spanner.connection.ConnectionOptions.ENABLE_API_TRACING_PROPERTY_NAME;
85+
import static com.google.cloud.spanner.connection.ConnectionOptions.ENABLE_DYNAMIC_CHANNEL_POOL_PROPERTY_NAME;
7886
import static com.google.cloud.spanner.connection.ConnectionOptions.ENABLE_END_TO_END_TRACING_PROPERTY_NAME;
7987
import static com.google.cloud.spanner.connection.ConnectionOptions.ENABLE_EXTENDED_TRACING_PROPERTY_NAME;
8088
import static com.google.cloud.spanner.connection.ConnectionOptions.ENABLE_GRPC_INTERCEPTOR_PROVIDER_SYSTEM_PROPERTY;
@@ -443,6 +451,45 @@ public class ConnectionProperties {
443451
DEFAULT_NUM_CHANNELS,
444452
NonNegativeIntegerConverter.INSTANCE,
445453
Context.STARTUP);
454+
static final ConnectionProperty<Boolean> ENABLE_DYNAMIC_CHANNEL_POOL =
455+
create(
456+
ENABLE_DYNAMIC_CHANNEL_POOL_PROPERTY_NAME,
457+
"Enable dynamic channel pooling for automatic gRPC channel scaling. When enabled, the "
458+
+ "client will automatically scale the number of channels based on load. Setting "
459+
+ "numChannels will disable dynamic channel pooling even if this is set to true. "
460+
+ "The default is currently false (disabled), but this may change to true in a "
461+
+ "future version. Set this property explicitly to ensure consistent behavior.",
462+
DEFAULT_ENABLE_DYNAMIC_CHANNEL_POOL,
463+
BOOLEANS,
464+
BooleanConverter.INSTANCE,
465+
Context.STARTUP);
466+
static final ConnectionProperty<Integer> DCP_MIN_CHANNELS =
467+
create(
468+
DCP_MIN_CHANNELS_PROPERTY_NAME,
469+
"The minimum number of channels in the dynamic channel pool. Only used when "
470+
+ "enableDynamicChannelPool is true. The default is "
471+
+ "SpannerOptions.DEFAULT_DYNAMIC_POOL_MIN_CHANNELS (2).",
472+
DEFAULT_DCP_MIN_CHANNELS,
473+
NonNegativeIntegerConverter.INSTANCE,
474+
Context.STARTUP);
475+
static final ConnectionProperty<Integer> DCP_MAX_CHANNELS =
476+
create(
477+
DCP_MAX_CHANNELS_PROPERTY_NAME,
478+
"The maximum number of channels in the dynamic channel pool. Only used when "
479+
+ "enableDynamicChannelPool is true. The default is "
480+
+ "SpannerOptions.DEFAULT_DYNAMIC_POOL_MAX_CHANNELS (10).",
481+
DEFAULT_DCP_MAX_CHANNELS,
482+
NonNegativeIntegerConverter.INSTANCE,
483+
Context.STARTUP);
484+
static final ConnectionProperty<Integer> DCP_INITIAL_CHANNELS =
485+
create(
486+
DCP_INITIAL_CHANNELS_PROPERTY_NAME,
487+
"The initial number of channels in the dynamic channel pool. Only used when "
488+
+ "enableDynamicChannelPool is true. The default is "
489+
+ "SpannerOptions.DEFAULT_DYNAMIC_POOL_INITIAL_SIZE (4).",
490+
DEFAULT_DCP_INITIAL_CHANNELS,
491+
NonNegativeIntegerConverter.INSTANCE,
492+
Context.STARTUP);
446493
static final ConnectionProperty<String> CHANNEL_PROVIDER =
447494
create(
448495
CHANNEL_PROVIDER_PROPERTY_NAME,

0 commit comments

Comments
 (0)