jiangxin369 commented on code in PR #248:
URL: https://github.com/apache/flink-ml/pull/248#discussion_r1297251801


##########
flink-ml-iteration/flink-ml-iteration-common/src/main/java/org/apache/flink/iteration/operator/HeadOperator.java:
##########
@@ -422,16 +430,44 @@ public void close() throws Exception {
         }
     }
 
-    private void registerFeedbackConsumer(Executor mailboxExecutor) {
+    private void registerFeedbackConsumer(Executor mailboxExecutor)
+            throws MemoryAllocationException {
+        StreamTask<?, ?> task = getContainingTask();
+
         int indexOfThisSubtask = getRuntimeContext().getIndexOfThisSubtask();
         int attemptNum = getRuntimeContext().getAttemptNumber();
         FeedbackKey<StreamRecord<IterationRecord<?>>> feedbackKey =
                 OperatorUtils.createFeedbackKey(iterationId, feedbackIndex);
         SubtaskFeedbackKey<StreamRecord<IterationRecord<?>>> key =
                 feedbackKey.withSubTaskIndex(indexOfThisSubtask, attemptNum);
-        FeedbackChannelBroker broker = FeedbackChannelBroker.get();
-        FeedbackChannel<StreamRecord<IterationRecord<?>>> channel = 
broker.getChannel(key);
-        OperatorUtils.registerFeedbackConsumer(channel, this, mailboxExecutor);
+        SpillableFeedbackChannelBroker broker = 
SpillableFeedbackChannelBroker.get();
+        this.feedbackChannel = broker.getChannel(key);

Review Comment:
   Sorry, I don's see the benefit of putting the logic in a Consumer, am I 
misunderstood? IMO, the current implementation of getChannal(key) / 
removeChannel(key) seems symmetrical and readable.



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