paimon
paimon copied to clipboard
[Feature] Change commit.callbacks order
Search before asking
- [x] I searched in the issues and found nothing similar.
Motivation
I'd like to utilize commit.callbacks and call a user callback after all system commit callbacks are called. For example, after creating Iceberg metadata, call the user callback.
Solution
he current implementation of commit.callbacks is used by IcebergCommitCallback and some other internal Paimon callbacks, but at the same time, the order is as follows:
- Add all user callbacks
- Add Paimon callbacks
private List<CommitCallback> createCommitCallbacks(String commitUser, FileStoreTable table) {
List<CommitCallback> callbacks = new ArrayList<>();
callbacks.addAll(CallbackUtils.loadCommitCallbacks(options, table));
... add AddPartitionCommitCallback
... add TagPreviewCommitCallback
... add IcebergCommitCallback
return callbacks;
}
Change it to:
- Add Paimon callbacks
- Add all user callbacks
private List<CommitCallback> createCommitCallbacks(String commitUser, FileStoreTable table) {
List<CommitCallback> callbacks = new ArrayList<>();
... add AddPartitionCommitCallback
... add TagPreviewCommitCallback
... add IcebergCommitCallback
callbacks.addAll(CallbackUtils.loadCommitCallbacks(options, table));
return callbacks;
}
Anything else?
No response
Are you willing to submit a PR?
- [x] I'm willing to submit a PR!