Skip to content

Conversation

@sakthivelmanii
Copy link
Collaborator

@sakthivelmanii sakthivelmanii commented Jun 26, 2025

BEGIN_COMMIT_OVERRIDE
chore: Allow JDBC to configure directpath for connection
END_COMMIT_OVERRIDE

Description:

Directpath allows GCP VM to connect to Spanner directly instead of going through public Google frontend. It improves the performance of the client library since all the requests are directly flowing to Spanner directly.

If client workload is deployed in non GCP VM, directpath will not work. it will fallback to connecting to Google public frondend.

In JDBC, we will be providing the support where customers can add the property attemptDirectPath=true which will enable directpath for the connection.

@sakthivelmanii sakthivelmanii requested review from a team as code owners June 26, 2025 17:52
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/java-spanner API. labels Jun 26, 2025
@sakthivelmanii sakthivelmanii requested a review from olavloite June 26, 2025 17:53
return this;
}

@BetaApi
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since directpath is not public GA, I have marked as @BetaApi

private String compressorName;
private String emulatorHost = System.getenv("SPANNER_EMULATOR_HOST");
private boolean leaderAwareRoutingEnabled = true;
private boolean attemptDirectPath = true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this configuration wasn't used at all so far, I changed the default behaviour.

@sakthivelmanii sakthivelmanii force-pushed the provide_support_to_enable_directpath branch from 63ca2f2 to 9b0c7bc Compare June 26, 2025 17:56
olavloite
olavloite previously approved these changes Jun 26, 2025
@olavloite olavloite merged commit 393a80d into main Jun 27, 2025
42 checks passed
@olavloite olavloite deleted the provide_support_to_enable_directpath branch June 27, 2025 05:33
@sakthivelmanii sakthivelmanii added the release-please:force-run To run release-please label Jun 27, 2025
@release-please release-please bot removed the release-please:force-run To run release-please label Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants