Abacn commented on code in PR #32561:
URL: https://github.com/apache/beam/pull/32561#discussion_r1775999962
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerAccessor.java:
##########
@@ -246,9 +249,21 @@ private static SpannerAccessor
createAndConnect(SpannerConfig spannerConfig) {
BatchClient batchClient =
spanner.getBatchClient(DatabaseId.of(options.getProjectId(),
instanceId, databaseId));
DatabaseAdminClient databaseAdminClient = spanner.getDatabaseAdminClient();
+ String instanceConfigId = "unknown";
+ try {
+ instanceConfigId =
Review Comment:
Per doc spanner FQN has format
`spanner:{projectId}.{instanceConfigId}.{instanceId}.{databaseId}.{assetId}`
However, currently instanceConfigId is not mentioned throughout SpannerIO.
Had to make a real API call to get instance config Id.
Because spannerAccessor is stored in a static concurrent Map, this call will
be done per (Dataflow worker) * (spanner instance destination)
cc: @manitgupta would like to learn if there a better way to do this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]