taegeonum commented on a change in pull request #151: [NEMO-267] Consider 
watermark holds in GroupByKeyAndWindowDoFnTransform
URL: https://github.com/apache/incubator-nemo/pull/151#discussion_r231362219
 
 

 ##########
 File path: 
compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/GroupByKeyAndWindowDoFnTransform.java
 ##########
 @@ -314,4 +345,31 @@ public TimerInternals timerInternalsForKey(final K key) {
       return stateAndTimerForKey.timerInternals;
     }
   }
+
+  /**
+   * This class wraps the output collector to track the watermark hold of each 
key.
+   */
+  final class GBKWOutputCollector implements 
OutputCollector<WindowedValue<KV<K, Iterable<InputT>>>> {
+    private final OutputCollector<WindowedValue<KV<K, Iterable<InputT>>>> 
outputCollector;
+    GBKWOutputCollector(final OutputCollector<WindowedValue<KV<K, 
Iterable<InputT>>>> outputCollector) {
+      this.outputCollector = outputCollector;
+    }
+
+    @Override
+    public void emit(final WindowedValue<KV<K, Iterable<InputT>>> output) {
+      // adds the output timestamp to the watermark hold of each key
+      // +1 to the output timestamp because if the window is [0-5000), the 
timestamp is 4999
 
 Review comment:
   Window [0~5000) is triggered at watermark 5000. This means that if we 
receive [0~5000) window as an output, the watermark is >= 5000. But the window 
output timestamp is 4999, so I added + 1 here 

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


With regards,
Apache Git Services

Reply via email to