Skip to content

Commit 1d7e4e1

Browse files
committed
feat: allow attempt direct path xds via env var
1 parent f4efd7a commit 1d7e4e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,11 @@ public GapicSpannerRpc(final SpannerOptions options) {
354354
options.isAttemptDirectPath()
355355
&& !Objects.equals(
356356
options.getScopedCredentials(), NoCredentials.getInstance()));
357+
String directPathXdsEnv = System.getenv("GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS");
358+
boolean isAttemptDirectPathXds = Boolean.parseBoolean(directPathXdsEnv);
359+
if (isAttemptDirectPathXds) {
360+
defaultChannelProviderBuilder.setAttemptDirectPathXds();
361+
}
357362
if (options.isUseVirtualThreads()) {
358363
ExecutorService executor =
359364
tryCreateVirtualThreadPerTaskExecutor("spanner-virtual-grpc-executor");

0 commit comments

Comments
 (0)