MCPcopy Create free account
hub / github.com/apache/paimon-rust / is_duplicate_commit

Method is_duplicate_commit

crates/paimon/src/table/table_commit.rs:505–522  ·  view source on GitHub ↗

Check if this commit was already completed (idempotency).

(
        &self,
        last_snapshot_for_dup_check: &Option<Snapshot>,
        latest_snapshot: &Option<Snapshot>,
        commit_kind: &CommitKind,
    )

Source from the content-addressed store, hash-verified

503
504 /// Check if this commit was already completed (idempotency).
505 async fn is_duplicate_commit(
506 &self,
507 last_snapshot_for_dup_check: &Option<Snapshot>,
508 latest_snapshot: &Option<Snapshot>,
509 commit_kind: &CommitKind,
510 ) -> bool {
511 if let (Some(prev_snap), Some(latest)) = (last_snapshot_for_dup_check, latest_snapshot) {
512 let start_id = prev_snap.id() + 1;
513 for snapshot_id in start_id..=latest.id() {
514 if let Ok(snap) = self.snapshot_manager.get_snapshot(snapshot_id).await {
515 if snap.commit_user() == self.commit_user && snap.commit_kind() == commit_kind {
516 return true;
517 }
518 }
519 }
520 }
521 false
522 }
523
524 /// Resolve commit entries and merge index entries based on the plan type.
525 async fn resolve_commit(

Callers 1

try_commitMethod · 0.80

Calls 4

get_snapshotMethod · 0.80
commit_userMethod · 0.80
commit_kindMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected