You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/05/19 18:45:44 UTC

[GitHub] [beam] pabloem commented on a change in pull request #11596: [BEAM-9856] Optimization/hl7v2 io list messages

pabloem commented on a change in pull request #11596:
URL: https://github.com/apache/beam/pull/11596#discussion_r427506366



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2IO.java
##########
@@ -431,25 +455,70 @@ private Message fetchMessage(HealthcareApiClient client, String msgId)
       this.filter = filter.get();
     }
 
+    /**
+     * Instantiates a new List hl 7 v 2 messages.
+     *
+     * @param hl7v2Stores the hl 7 v 2 stores
+     * @param filter the filter
+     * @param initialSplitDuration the initial split duration for sendTime dimension splits
+     */
+    ListHL7v2Messages(
+        ValueProvider<List<String>> hl7v2Stores,
+        ValueProvider<String> filter,
+        Duration initialSplitDuration) {
+      this.hl7v2Stores = hl7v2Stores.get();
+      this.filter = filter.get();
+      this.initialSplitDuration = initialSplitDuration;

Review comment:
       `ValueProvider` arguments are usually not known at pipeline construction time, so it is not useful to call `get` on them when you create the PCollection. The usual method is to have ValueProvider attributes for the class - when you get String arguments, you would wrap them with `StaticValueProvider` - and in the execution-time methods (e.g. processelement, finish/startbundle), you would call `get` on the valueproviders. I seem to have missed this point earlier. sorry about that.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org