pl04351820 commented on code in PR #27987:
URL: https://github.com/apache/beam/pull/27987#discussion_r1360886806
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1.java:
##########
@@ -1526,15 +1748,28 @@ static class DatastoreWriterFn extends DoFn<Mutation,
Void> {
@Nullable String localhost,
V1DatastoreFactory datastoreFactory,
WriteBatcher writeBatcher) {
+ this(projectId, null, localhost, datastoreFactory, writeBatcher);
+ }
+
+ @VisibleForTesting
+ DatastoreWriterFn(
+ ValueProvider<String> projectId,
+ ValueProvider<String> databaseIdProvider,
+ @Nullable String localhost,
+ V1DatastoreFactory datastoreFactory,
+ WriteBatcher writeBatcher) {
this.projectId = checkNotNull(projectId, "projectId");
+ this.databaseId = databaseIdProvider == null ? DEFAULT_DATABASE :
databaseIdProvider.get();
Review Comment:
Thanks for the suggestions. Keep ValueProvider in constructor.
--
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]