JerryYue-M commented on code in PR #7099:
URL: https://github.com/apache/hudi/pull/7099#discussion_r1035961377
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -503,10 +509,29 @@ private boolean commitInstant(String instant, long
checkpointId) {
sendCommitAckEvents(checkpointId);
return false;
}
+ setMinEventTime();
doCommit(instant, writeResults);
+ resetMinEventTime();
return true;
}
+ public void setMinEventTime() {
+ if (commitEventTimeEnable) {
+ LOG.info("receive event time for current commit: {} ",
Arrays.stream(eventBuffer).collect(Collectors.toMap(WriteMetadataEvent::getTaskID,
WriteMetadataEvent::getMaxEventTime)));
+ this.minEventTime = Arrays.stream(eventBuffer)
+ .filter(Objects::nonNull)
+ .map(WriteMetadataEvent::getMaxEventTime)
+ .filter(maxEventTime -> maxEventTime > 0)
+ .min(Comparator.naturalOrder())
+ .map(aLong -> Math.min(aLong,
this.minEventTime)).orElse(Long.MAX_VALUE);
+ LOG.info("[setMinEventTime] minEventTime: {} ", this.minEventTime);
+ }
+ }
+
+ public void resetMinEventTime() {
Review Comment:
no, we need reset min event time for each commit
--
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]