Skip to content

Commit 1df09d9

Browse files
feat: remove grpclb (#2760)
* chore: add DirectPath fallback integration test * feat: remove grpclb * feat: remove grpclb * feat: remove grpclb * feat: remove grpclb --------- Co-authored-by: Knut Olav Løite <[email protected]>
1 parent 389a830 commit 1df09d9

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

google-cloud-spanner/pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
<groupId>org.apache.maven.plugins</groupId>
152152
<artifactId>maven-dependency-plugin</artifactId>
153153
<configuration>
154-
<ignoredDependencies>io.grpc:grpc-protobuf-lite,org.hamcrest:hamcrest,org.hamcrest:hamcrest-core,com.google.errorprone:error_prone_annotations,org.openjdk.jmh:jmh-generator-annprocess,com.google.api.grpc:grpc-google-cloud-spanner-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-instance-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-database-v1,javax.annotation:javax.annotation-api,io.opencensus:opencensus-impl,org.graalvm.sdk:graal-sdk,io.grpc:grpc-grpclb,io.grpc:grpc-googleapis,io.grpc:grpc-rls,com.google.api.grpc:proto-google-cloud-spanner-executor-v1,com.google.api.grpc:grpc-google-cloud-spanner-executor-v1</ignoredDependencies>
154+
<ignoredDependencies>io.grpc:grpc-protobuf-lite,org.hamcrest:hamcrest,org.hamcrest:hamcrest-core,com.google.errorprone:error_prone_annotations,org.openjdk.jmh:jmh-generator-annprocess,com.google.api.grpc:grpc-google-cloud-spanner-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-instance-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-database-v1,javax.annotation:javax.annotation-api,io.opencensus:opencensus-impl,org.graalvm.sdk:graal-sdk,io.grpc:grpc-googleapis,io.grpc:grpc-rls,com.google.api.grpc:proto-google-cloud-spanner-executor-v1,com.google.api.grpc:grpc-google-cloud-spanner-executor-v1</ignoredDependencies>
155155
</configuration>
156156
</plugin>
157157
</plugins>
@@ -325,11 +325,6 @@
325325
<groupId>io.grpc</groupId>
326326
<artifactId>grpc-alts</artifactId>
327327
</dependency>
328-
<dependency>
329-
<groupId>io.grpc</groupId>
330-
<artifactId>grpc-grpclb</artifactId>
331-
<scope>runtime</scope>
332-
</dependency>
333328
<dependency>
334329
<groupId>io.grpc</groupId>
335330
<artifactId>grpc-googleapis</artifactId>

google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import com.google.api.gax.rpc.UnavailableException;
5555
import com.google.api.gax.rpc.WatchdogProvider;
5656
import com.google.api.pathtemplate.PathTemplate;
57-
import com.google.cloud.NoCredentials;
5857
import com.google.cloud.RetryHelper;
5958
import com.google.cloud.RetryHelper.RetryHelperException;
6059
import com.google.cloud.grpc.GcpManagedChannelBuilder;
@@ -344,19 +343,11 @@ public GapicSpannerRpc(final SpannerOptions options) {
344343
// This sets the response compressor (Server -> Client).
345344
.withEncoding(compressorName))
346345
.setHeaderProvider(headerProviderWithUserAgent)
347-
.setAllowNonDefaultServiceAccount(true)
348-
// Attempts direct access to spanner service over gRPC to improve throughput,
349-
// whether the attempt is allowed is totally controlled by service owner.
350-
// We'll only attempt DirectPath if we are using real credentials.
351-
// NoCredentials is used for plain text connections, for example when connecting to
352-
// the emulator.
353-
.setAttemptDirectPath(
354-
options.isAttemptDirectPath()
355-
&& !Objects.equals(
356-
options.getScopedCredentials(), NoCredentials.getInstance()));
346+
.setAllowNonDefaultServiceAccount(true);
357347
String directPathXdsEnv = System.getenv("GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS");
358348
boolean isAttemptDirectPathXds = Boolean.parseBoolean(directPathXdsEnv);
359349
if (isAttemptDirectPathXds) {
350+
defaultChannelProviderBuilder.setAttemptDirectPath(true);
360351
defaultChannelProviderBuilder.setAttemptDirectPathXds();
361352
}
362353
if (options.isUseVirtualThreads()) {

google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public GceTestEnvConfig() {
9797
customChannelProviderBuilder
9898
.setEndpoint(DIRECT_PATH_ENDPOINT)
9999
.setAttemptDirectPath(true)
100+
.setAttemptDirectPathXds()
100101
.setInterceptorProvider(interceptorProvider);
101102
builder.setChannelProvider(customChannelProviderBuilder.build());
102103
}

0 commit comments

Comments
 (0)