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

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

                Author: ASF GitHub Bot
            Created on: 19/Mar/18 22:15
            Start Date: 19/Mar/18 22:15
    Worklog Time Spent: 10m 
      Work Description: tgroh commented on a change in pull request #4793: 
[BEAM-3776] Fix issue with merging late windows where a watermark hold could be 
added behind the input watermark.
URL: https://github.com/apache/beam/pull/4793#discussion_r175587347
 
 

 ##########
 File path: 
runners/core-java/src/test/java/org/apache/beam/runners/core/ReduceFnTester.java
 ##########
 @@ -533,28 +534,33 @@ public void advanceSynchronizedProcessingTime(
    */
   @SafeVarargs
   public final void injectElements(TimestampedValue<InputT>... values) throws 
Exception {
+    injectElements(Arrays.asList(values));
+  }
+
+  public final void injectElements(Iterable<TimestampedValue<InputT>> values) 
throws Exception {
     for (TimestampedValue<InputT> value : values) {
       WindowTracing.trace("TriggerTester.injectElements: {}", value);
     }
 
     Iterable<WindowedValue<InputT>> inputs =
-        Arrays.asList(values)
-            .stream()
-            .map(
-                input -> {
-                  try {
-                    InputT value = input.getValue();
-                    Instant timestamp = input.getTimestamp();
-                    Collection<W> windows =
-                        windowFn.assignWindows(
-                            new TestAssignContext<W>(
-                                windowFn, value, timestamp, 
GlobalWindow.INSTANCE));
-                    return WindowedValue.of(value, timestamp, windows, 
PaneInfo.NO_FIRING);
-                  } catch (Exception e) {
-                    throw new RuntimeException(e);
-                  }
-                })
-            .collect(Collectors.toList());
+        Iterables.transform(
 
 Review comment:
   this seems like the wrong direction for this change - certainly the 
lambda-to-function.
   
   You can use `StreamSupport` to keep using streams

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 82067)
    Time Spent: 3h 10m  (was: 3h)

> StateMerging.mergeWatermarks sets a late watermark hold for late merging 
> windows that depend only on the window
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-3776
>                 URL: https://issues.apache.org/jira/browse/BEAM-3776
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-core
>    Affects Versions: 2.1.0, 2.2.0, 2.3.0
>            Reporter: Sam Whittle
>            Assignee: Sam Whittle
>            Priority: Critical
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> WatermarkHold.addElementHold and WatermarkHold.addGarbageCollectionHold take 
> to not add holds that would be before the input watermark.
> However WatermarkHold.onMerge calls StateMerging.mergeWatermarks which if the 
> window depends only on window, sets a hold for the end of the window 
> regardless of the input watermark.
> Thus if you have a WindowingStrategy such as:
> WindowingStrategy.of(Sessions.withGapDuration(gapDuration))
>  .withMode(AccumulationMode.DISCARDING_FIRED_PANES)
>  .withTrigger(
>  Repeatedly.forever(
>  AfterWatermark.pastEndOfWindow()
>  .withLateFirings(AfterPane.elementCountAtLeast(10))))
>  .withAllowedLateness(allowedLateness))
> and you merge windows that are late, you might end up holding the watermark 
> until the allowedLateness has passed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to