[ 
https://issues.apache.org/jira/browse/BEAM-10141?focusedWorklogId=440362&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-440362
 ]

ASF GitHub Bot logged work on BEAM-10141:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Jun/20 17:58
            Start Date: 02/Jun/20 17:58
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #11862:
URL: https://github.com/apache/beam/pull/11862#discussion_r434064107



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2IO.java
##########
@@ -179,25 +189,51 @@ public static ListHL7v2Messages readAll(List<String> 
hl7v2Stores) {
     return new ListHL7v2Messages(StaticValueProvider.of(hl7v2Stores), 
StaticValueProvider.of(null));
   }
 
+  /** Read all HL7v2 Messages from multiple stores as sendTime {@link 
TimestampedValue}s. */
+  public static ListTimestampedHL7v2Messages 
readAllWithTimestamps(List<String> hl7v2Stores) {

Review comment:
       Instead of adding static methods for each variant, any reason to not 
make ListHL7v2Messages be a builder so someone could invoke 
`withMessageTimestamps`?
   
   This would have also make sense to make `withFilter` a builder like method 
on ListHL7v2Messages

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2IO.java
##########
@@ -397,7 +492,8 @@ public void instantiateHealthcareClient() throws 
IOException {
         public void processElement(ProcessContext context) {
           String msgId = context.element();
           try {
-            context.output(HL7v2Message.fromModel(fetchMessage(this.client, 
msgId)));
+            HL7v2Message msg = 
HL7v2Message.fromModel(fetchMessage(this.client, msgId));
+            context.output(TimestampedValue.of(msg, 
Instant.parse(msg.getSendTime())));

Review comment:
       You should really be using `context.outputWithTimestamp` and not 
`TimestampedValue`.
   
   It would make sense to have an object that chooses which timestamp to use 
(input elements timestamp or messages send time) instead of having a different 
variant of the DoFn. In both cases you would use the monotonically increasing 
estimator.




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 440362)
    Time Spent: 40m  (was: 0.5h)

> HL7v2IO read methods should assign sendTime timestamps
> ------------------------------------------------------
>
>                 Key: BEAM-10141
>                 URL: https://issues.apache.org/jira/browse/BEAM-10141
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-gcp
>            Reporter: Jacob Ferriero
>            Assignee: Jacob Ferriero
>            Priority: P3
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Per Suggestion in this 
> [conversation|https://github.com/apache/beam/pull/11596#discussion_r427633240]
> Add timestamped values and watermark estimate to
>  HL7v2IO.ListMessages. The same argument can be made for making HL7v2IO.Read 
> return timestamped values.
> This should be optional and default to false to not be interface breaking.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to