openinx commented on a change in pull request #1404:
URL: https://github.com/apache/iceberg/pull/1404#discussion_r480656851
##########
File path:
flink/src/main/java/org/apache/iceberg/flink/sink/IcebergFilesCommitter.java
##########
@@ -151,13 +169,16 @@ public void notifyCheckpointComplete(long checkpointId)
throws Exception {
// For step#4, we don't need to commit iceberg table again because in
step#3 we've committed all the files,
// Besides, we need to maintain the max-committed-checkpoint-id to be
increasing.
if (checkpointId > maxCommittedCheckpointId) {
- commitUpToCheckpoint(checkpointId);
+ commitUpToCheckpoint(table, dataFilesPerCheckpoint, flinkJobId,
checkpointId);
this.maxCommittedCheckpointId = checkpointId;
}
}
- private void commitUpToCheckpoint(long checkpointId) {
- NavigableMap<Long, List<DataFile>> pendingFileMap =
dataFilesPerCheckpoint.headMap(checkpointId, true);
+ private static void commitUpToCheckpoint(Table table,
Review comment:
Because I want the user to explicitly write the parameters on the
method, to avoid unexpected bugs caused by the usage of the internal variables
of the class. I encountered the bug before because I used the current
`flinkJobId`
[here](https://github.com/apache/iceberg/pull/1404/files#diff-768ddf11822e9ddb5fd460fb4978d79dR191)
unintentionally when `commitUpToCheckpoint` in the restoring
[path](https://github.com/apache/iceberg/pull/1404/files#diff-768ddf11822e9ddb5fd460fb4978d79dR136),
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]