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



##########
File path: 
flink-ml-iteration/src/main/java/org/apache/flink/iteration/operator/coordinator/HeadOperatorCoordinator.java
##########
@@ -61,6 +62,12 @@ public void subtaskReady(int i, SubtaskGateway 
subtaskGateway) {
         this.subtaskGateways[i] = subtaskGateway;
     }
 
+    @Override
+    public void resetToCheckpoint(long l, @Nullable byte[] bytes) {}

Review comment:
       l -> checkpointId

##########
File path: 
flink-ml-iteration/src/main/java/org/apache/flink/iteration/operator/HeadOperator.java
##########
@@ -155,12 +176,19 @@ public void 
processFeedback(StreamRecord<IterationRecord<?>> iterationRecord) th
     @Override
     public void handleOperatorEvent(OperatorEvent operatorEvent) {
         if (operatorEvent instanceof GloballyAlignedEvent) {
-            boolean shouldTerminate =
-                    recordProcessor.onGloballyAligned((GloballyAlignedEvent) 
operatorEvent);
-            if (shouldTerminate) {
-                status = HeadOperatorStatus.TERMINATING;
-                recordProcessor = new TerminatingHeadOperatorRecordProcessor();
-            }
+            checkpointAligner
+                    .checkHoldingGloballyAlignedEvent((GloballyAlignedEvent) 
operatorEvent)
+                    .ifPresent(this::processGloballyAlignedEvent);
+        } else if (operatorEvent instanceof CoordinatorCheckpointEvent) {
+            checkpointAligner.coordinatorNotify((CoordinatorCheckpointEvent) 
operatorEvent);
+        }

Review comment:
       Maybe we could throw `Exception` if the `operatorEvent` is unexpected.

##########
File path: 
flink-ml-iteration/src/main/java/org/apache/flink/iteration/operator/coordinator/HeadOperatorCoordinator.java
##########
@@ -61,6 +62,12 @@ public void subtaskReady(int i, SubtaskGateway 
subtaskGateway) {
         this.subtaskGateways[i] = subtaskGateway;
     }
 
+    @Override
+    public void resetToCheckpoint(long l, @Nullable byte[] bytes) {}
+
+    @Override
+    public void subtaskFailed(int i, @Nullable Throwable throwable) {}

Review comment:
       i -> subtaskId or subtaskIndex?




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