You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "pcostell (via GitHub)" <gi...@apache.org> on 2023/07/19 22:13:30 UTC

[GitHub] [beam] pcostell commented on a diff in pull request #27256: Enable FirestoreV1IT to run against a non default host

pcostell commented on code in PR #27256:
URL: https://github.com/apache/beam/pull/27256#discussion_r1268730895


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreStatefulComponentFactory.java:
##########
@@ -86,7 +90,11 @@ FirestoreStub getFirestoreStub(PipelineOptions options) {
 
       FirestoreOptions firestoreOptions = options.as(FirestoreOptions.class);
       String emulatorHostPort = firestoreOptions.getEmulatorHost();
+      if (emulatorHostPort == null) {
+        emulatorHostPort = System.getenv(FIRESTORE_EMULATOR_HOST_ENV_VARIABLE);
+      }
       if (emulatorHostPort != null) {
+        firestoreOptions.setEmulatorHost(emulatorHostPort);

Review Comment:
   Injecting the value back into the value given to us does not make sense -- we should be treating the options argument as immutable.



-- 
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