Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove grpclb #2760

Merged
merged 16 commits into from
Apr 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: remove grpclb
  • Loading branch information
mohanli-ml committed Dec 18, 2023
commit 3e3bdbc0c56cbb4c85bb99454876de1e7d31893c
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,7 @@ public GapicSpannerRpc(final SpannerOptions options) {
SpannerInterceptorProvider.createDefault()))
// This sets the response compressor (Server -> Client).
.withEncoding(compressorName))
.setHeaderProvider(headerProviderWithUserAgent)
// Attempts direct access to spanner service over gRPC to improve throughput,
// whether the attempt is allowed is totally controlled by service owner.
.setAttemptDirectPath(true);
.setHeaderProvider(headerProviderWithUserAgent);

// If it is enabled in options uses the channel pool provided by the gRPC-GCP extension.
maybeEnableGrpcGcpExtension(defaultChannelProviderBuilder, options);
Expand All @@ -368,9 +365,7 @@ public GapicSpannerRpc(final SpannerOptions options) {
try {
this.spannerStub =
GrpcSpannerStub.create(
options
.getSpannerStubSettings()
.toBuilder()
options.getSpannerStubSettings().toBuilder()
.setTransportChannelProvider(channelProvider)
.setCredentialsProvider(credentialsProvider)
.setStreamWatchdogProvider(watchdogProvider)
Expand All @@ -384,11 +379,7 @@ public GapicSpannerRpc(final SpannerOptions options) {
this.executeQueryRetryableCodes =
options.getSpannerStubSettings().executeStreamingSqlSettings().getRetryableCodes();
partitionedDmlRetrySettings =
options
.getSpannerStubSettings()
.executeSqlSettings()
.getRetrySettings()
.toBuilder()
options.getSpannerStubSettings().executeSqlSettings().getRetrySettings().toBuilder()
.setInitialRpcTimeout(options.getPartitionedDmlTimeout())
.setMaxRpcTimeout(options.getPartitionedDmlTimeout())
.setTotalTimeout(options.getPartitionedDmlTimeout())
Expand Down Expand Up @@ -421,18 +412,14 @@ public GapicSpannerRpc(final SpannerOptions options) {

this.instanceAdminStub =
GrpcInstanceAdminStub.create(
options
.getInstanceAdminStubSettings()
.toBuilder()
options.getInstanceAdminStubSettings().toBuilder()
.setTransportChannelProvider(channelProvider)
.setCredentialsProvider(credentialsProvider)
.setStreamWatchdogProvider(watchdogProvider)
.build());

this.databaseAdminStubSettings =
options
.getDatabaseAdminStubSettings()
.toBuilder()
options.getDatabaseAdminStubSettings().toBuilder()
.setTransportChannelProvider(channelProvider)
.setCredentialsProvider(credentialsProvider)
.setStreamWatchdogProvider(watchdogProvider)
Expand Down Expand Up @@ -587,9 +574,7 @@ private static void checkEmulatorConnection(
// Do a quick check to see if the emulator is actually running.
try {
InstanceAdminStubSettings.Builder testEmulatorSettings =
options
.getInstanceAdminStubSettings()
.toBuilder()
options.getInstanceAdminStubSettings().toBuilder()
.setTransportChannelProvider(channelProvider)
.setCredentialsProvider(credentialsProvider);
testEmulatorSettings
Expand Down
Loading