yunfengzhou-hub commented on a change in pull request #17:
URL: https://github.com/apache/flink-ml/pull/17#discussion_r726855274



##########
File path: 
flink-ml-iteration/src/main/java/org/apache/flink/ml/iteration/operator/headprocessor/RegularHeadOperatorRecordProcessor.java
##########
@@ -83,44 +107,88 @@ public boolean 
processFeedbackElement(StreamRecord<IterationRecord<?>> element)
     @Override
     public boolean onGloballyAligned(GloballyAlignedEvent 
globallyAlignedEvent) {
         LOG.info("Received global event {}", globallyAlignedEvent);
-
-        reusable.replace(
-                IterationRecord.newEpochWatermark(
-                        globallyAlignedEvent.isTerminated()
-                                ? Integer.MAX_VALUE
-                                : globallyAlignedEvent.getRound(),
-                        senderId),
-                0);
-        headOperatorContext.broadcastOutput(reusable);
+        checkState(
+                (globallyAlignedEvent.getRound() == 0 && 
latestRoundGloballyAligned == 0)
+                        || globallyAlignedEvent.getRound() > 
latestRoundGloballyAligned,
+                String.format(
+                        "Receive unexpected global aligned event, latest = %d, 
this one = %d",
+                        latestRoundGloballyAligned, 
globallyAlignedEvent.getRound()));
+
+        StreamRecord<IterationRecord<?>> record =
+                new StreamRecord<>(

Review comment:
       Why do we choose to create a new instance each time instead fo reusing 
one instance?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to