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

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

                Author: ASF GitHub Bot
            Created on: 16/May/20 22:01
            Start Date: 16/May/20 22:01
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #11735:
URL: https://github.com/apache/beam/pull/11735#discussion_r426195050



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/io/Read.java
##########
@@ -487,51 +493,54 @@ public void splitRestriction(
 
     @NewTracker
     public RestrictionTracker<
-            KV<UnboundedSource<OutputT, CheckpointT>, CheckpointT>, 
UnboundedSourceValue<OutputT>[]>
+            UnboundedSourceRestriction<OutputT, CheckpointT>, 
UnboundedSourceValue<OutputT>[]>
         restrictionTracker(
-            @Restriction KV<UnboundedSource<OutputT, CheckpointT>, 
CheckpointT> restriction,
+            @Restriction UnboundedSourceRestriction<OutputT, CheckpointT> 
restriction,
             PipelineOptions pipelineOptions) {
       return new UnboundedSourceAsSDFRestrictionTracker(restriction, 
pipelineOptions);
     }
 
     @ProcessElement
     public ProcessContinuation processElement(
-        RestrictionTracker<
-                KV<UnboundedSource<OutputT, CheckpointT>, CheckpointT>, 
UnboundedSourceValue[]>
+        RestrictionTracker<UnboundedSourceRestriction<OutputT, CheckpointT>, 
UnboundedSourceValue[]>
             tracker,
         ManualWatermarkEstimator<Instant> watermarkEstimator,
         OutputReceiver<ValueWithRecordId<OutputT>> receiver,
         BundleFinalizer bundleFinalizer)
         throws IOException {
-      KV<UnboundedSource<OutputT, CheckpointT>, CheckpointT> 
initialRestriction =
+      UnboundedSourceRestriction<OutputT, CheckpointT> initialRestriction =
           tracker.currentRestriction();
 
       UnboundedSourceValue<OutputT>[] out = new UnboundedSourceValue[1];
       while (tracker.tryClaim(out)) {
         receiver.outputWithTimestamp(
             new ValueWithRecordId<>(out[0].getValue(), out[0].getId()), 
out[0].getTimestamp());
-        
watermarkEstimator.setWatermark(ensureTimestampWithinBounds(out[0].getWatermark()));
       }
 
+      UnboundedSourceRestriction<OutputT, CheckpointT> currentRestriction =
+          tracker.currentRestriction();
+
+      // Advance the watermark even if zero elements may have been output.

Review comment:
       This is the key part of the change here, moving 
`watermarkEstimator.setWatermark` out of the while loop.




----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 434115)
    Time Spent: 32h 50m  (was: 32h 40m)

> Fn API SDF support
> ------------------
>
>                 Key: BEAM-2939
>                 URL: https://issues.apache.org/jira/browse/BEAM-2939
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model
>            Reporter: Henning Rohde
>            Assignee: Luke Cwik
>            Priority: P2
>              Labels: portability
>          Time Spent: 32h 50m
>  Remaining Estimate: 0h
>
> The Fn API should support streaming SDF. Detailed design TBD.
> Once design is ready, expand subtasks similarly to BEAM-2822.



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

Reply via email to