dawidwys commented on a change in pull request #16135:
URL: https://github.com/apache/flink/pull/16135#discussion_r656315138
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/SingleCheckpointBarrierHandler.java
##########
@@ -299,18 +294,23 @@ private void registerAlignmentTimer(CheckpointBarrier
announcedBarrier) {
announcedBarrier.getCheckpointOptions().getAlignmentTimeout()));
}
- private boolean checkNewCheckpoint(CheckpointBarrier barrier) throws
IOException {
+ private void checkNewCheckpoint(CheckpointBarrier barrier) throws
IOException {
long barrierId = barrier.getId();
- if (currentCheckpointId < barrierId) {
- if (isCheckpointPending()) {
- cancelSubsumedCheckpoint(barrierId);
- }
- currentCheckpointId = barrierId;
- numBarriersReceived = 0;
- allBarriersReceivedFuture = new CompletableFuture<>();
- return true;
+ if (currentCheckpointId >= barrierId) {
Review comment:
Nice refactoring! I like returning early.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]