nielm commented on code in PR #31008:
URL: https://github.com/apache/beam/pull/31008#discussion_r1620320771
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java:
##########
@@ -2256,6 +2264,21 @@ private void
spannerWriteWithRetryIfSchemaChange(List<Mutation> batch) throws Sp
}
}
+ private Options.TransactionOption[] getTransactionOptions() {
+ return Stream.of(
+ spannerConfig.getRpcPriority() != null &&
spannerConfig.getRpcPriority().get() != null
+ ? Options.priority(spannerConfig.getRpcPriority().get())
+ : null,
Review Comment:
I don't see what you mean here. This code is refactoring setting the
transaction options to a separate function, and adding the `MaxCommitDelay`
oprion.
In the old code, (L2230) if there is a `RpcPriority` value set, it calls
`.writeAtLeastOnceWithOptions(batch,
Options.priority(spannerConfig.getRpcPriority().get()));`
and if not,
`spannerAccessor.getDatabaseClient().writeAtLeastOnce(batch);`
In the new code it always calls
`.writeAtLeastOnceWithOptions(batch,getTransactionOptions())`
where `getTransactionOptions())` returns an array of non-null
`Option.TransactionOption` containing `RpcPriority` and/or `MaxCommitDelay` if
they are set.
--
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]