paimon icon indicating copy to clipboard operation
paimon copied to clipboard

[Feature] Change commit.callbacks order

Open muttcg opened this issue 1 month ago • 0 comments

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:

  1. Add all user callbacks
  2. 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:

  1. Add Paimon callbacks
  2. 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!

muttcg avatar Nov 13 '25 18:11 muttcg