You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "kennknowles (via GitHub)" <gi...@apache.org> on 2023/09/15 15:41:15 UTC
[GitHub] [beam] kennknowles commented on a diff in pull request #28374: Add mechanism to override bigtable client for testing
kennknowles commented on code in PR #28374:
URL: https://github.com/apache/beam/pull/28374#discussion_r1327473112
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableConfig.java:
##########
@@ -156,6 +162,12 @@ public BigtableConfig withEmulator(String emulatorHost) {
return toBuilder().setEmulatorHost(emulatorHost).build();
}
+ @VisibleForTesting
+ BigtableConfig withBigtableClientOverride(BigtableClientOverride clientOverride) {
+ checkArgument(clientOverride != null, "clientOverride can not be null");
Review Comment:
If someone has set the override and you want to clear it, how do you do that?
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java:
##########
@@ -1988,6 +1989,24 @@ public ReadChangeStream withMetadataTableAppProfileId(String appProfileId) {
.build();
}
+ /**
+ * Returns a new {@link BigtableIO.ReadChangeStream} that overrides the config of data and/or
+ * admin client for streaming changes and for managing the metadata. For testing purposes only.
+ * Not intended for use.
Review Comment:
Maybe this is useful also for regional endpoints or some such? (no action required - it is certainly always easier to make things more visible than less visible)
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java:
##########
@@ -1988,6 +1989,24 @@ public ReadChangeStream withMetadataTableAppProfileId(String appProfileId) {
.build();
}
+ /**
+ * Returns a new {@link BigtableIO.ReadChangeStream} that overrides the config of data and/or
+ * admin client for streaming changes and for managing the metadata. For testing purposes only.
+ * Not intended for use.
+ *
+ * <p>Does not modify this object.
+ */
+ @VisibleForTesting
Review Comment:
It says visible for testing, but there are no tests. It seems like you can test this by setting up the `PipelineOptions` in the test before you expand the `BigTableChangeStreamsAccessor`
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org