jiangxin369 commented on code in PR #248:
URL: https://github.com/apache/flink-ml/pull/248#discussion_r1298087863
##########
flink-ml-iteration/flink-ml-iteration-common/src/main/java/org/apache/flink/iteration/typeinfo/IterationRecordSerializer.java:
##########
@@ -106,7 +106,7 @@ public int getLength() {
@Override
public void serialize(IterationRecord<T> record, DataOutputView target)
throws IOException {
target.writeByte((byte) record.getType().ordinal());
- serializerNumber(record.getEpoch(), target);
+ target.writeInt(record.getEpoch());
Review Comment:
Currently, the `Integer.MAX_VALUE + 1` is passed because the termination
check is in the `HeadOperator` . When the `TailOperator` processed the last
epoch_watermark, it needs to increment the epoch which is already
`Integer.MAX_VALUE`, and send the increased epoch to the `HeadOperator`. Then
the `TerminatingHeadOperatorRecordProcessor#processFeedbackElement` would check
if the epoch is equal to `Integer.MAX_VALUE + 1` to determine whether to
terminate the iteration.
Of course, we can avoid it. Maybe simply change the last epoch_watermark
number to `Integer.MAX_VALUE - 1`, but I don't think we need to make the code
less readable for this.
--
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]