leaves12138 commented on code in PR #1690:
URL: https://github.com/apache/incubator-paimon/pull/1690#discussion_r1280267352
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/AppendOnlyTableCompactionWorkerOperator.java:
##########
@@ -52,25 +70,105 @@ public AppendOnlyTableCompactionWorkerOperator(
@Override
public void open() throws Exception {
+ LOG.debug("Opened a append-only table compaction worker.");
this.worker = new AppendOnlyTableCompactionWorker(table, commitUser);
- this.result = new ArrayList<>();
+ this.result = new LinkedList<>();
}
@Override
protected List<Committable> prepareCommit(boolean waitCompaction, long
checkpointId)
throws IOException {
- // ignore waitCompaction tag
- ArrayList<CommitMessage> tempList = new ArrayList<>(result);
- result.clear();
- return tempList.stream()
- .map(s -> new Committable(checkpointId, Committable.Kind.FILE,
s))
- .collect(Collectors.toList());
+ List<CommitMessage> tempList = new ArrayList<>();
+ try {
+ while (!result.isEmpty()) {
+ Future<List<CommitMessage>> future = result.peek();
+ if (!future.isDone()) {
Review Comment:
reasonable
--
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]