2020#include < functional>
2121#include < memory>
2222#include < optional>
23+ #include < string>
2324#include < unordered_map>
2425#include < vector>
2526
@@ -35,6 +36,7 @@ namespace paimon {
3536class ManifestEntry ;
3637struct IndexManifestEntry ;
3738class CommitScanner ;
39+ class FileStorePathFactory ;
3840class ManifestFile ;
3941class ManifestList ;
4042class RowIdColumnConflictChecker ;
@@ -48,7 +50,9 @@ class ConflictDetection {
4850 std::shared_ptr<SnapshotManager> snapshot_manager,
4951 std::shared_ptr<ManifestList> manifest_list,
5052 std::shared_ptr<ManifestFile> manifest_file,
51- std::shared_ptr<CommitScanner> commit_scanner);
53+ std::shared_ptr<CommitScanner> commit_scanner, const std::string& commit_user,
54+ const std::string& table_name,
55+ const std::shared_ptr<FileStorePathFactory>& path_factory);
5256
5357 Status CheckConflicts (const Snapshot& latest_snapshot,
5458 const std::vector<ManifestEntry>& base_entries,
@@ -75,17 +79,37 @@ class ConflictDetection {
7579
7680 private:
7781 Status CheckBucketKeepSame (const std::vector<ManifestEntry>& all_entries,
78- const Snapshot::CommitKind& commit_kind) const ;
82+ const Snapshot::CommitKind& commit_kind,
83+ const std::string& base_commit_user,
84+ const std::vector<ManifestEntry>& base_entries,
85+ const std::vector<ManifestEntry>& delta_entries) const ;
7986
8087 Status BucketNumMismatch (const BinaryRow& partition, int32_t num_buckets,
8188 int32_t previous_num_buckets) const ;
8289
90+ Status TotalBucketsChanged (const BinaryRow& partition, int32_t num_buckets,
91+ int32_t previous_num_buckets, const std::string& base_commit_user,
92+ const std::vector<ManifestEntry>& base_entries,
93+ const std::vector<ManifestEntry>& delta_entries) const ;
94+
95+ std::string BuildConflictMessage (const std::string& message,
96+ const std::string& base_commit_user,
97+ const std::vector<ManifestEntry>& base_entries,
98+ const std::vector<ManifestEntry>& delta_entries,
99+ const std::string& cause = " " ) const ;
100+
83101 void MarkBucketCheckedPartitions (
84102 const std::unordered_map<BinaryRow, int32_t >& total_buckets) const ;
85103
86- Status CheckDeleteInEntries (const std::vector<ManifestEntry>& merged_entries) const ;
104+ Status CheckDeleteInEntries (const std::vector<ManifestEntry>& merged_entries,
105+ const std::string& base_commit_user,
106+ const std::vector<ManifestEntry>& base_entries,
107+ const std::vector<ManifestEntry>& delta_entries) const ;
87108
88- Status CheckKeyRange (const std::vector<ManifestEntry>& merged_entries) const ;
109+ Status CheckKeyRange (const std::vector<ManifestEntry>& merged_entries,
110+ const std::string& base_commit_user,
111+ const std::vector<ManifestEntry>& base_entries,
112+ const std::vector<ManifestEntry>& delta_entries) const ;
89113
90114 Status CheckRowIdExistence (const std::vector<ManifestEntry>& base_entries,
91115 const std::vector<ManifestEntry>& delta_entries,
@@ -121,6 +145,9 @@ class ConflictDetection {
121145 std::shared_ptr<ManifestList> manifest_list_;
122146 std::shared_ptr<ManifestFile> manifest_file_;
123147 std::shared_ptr<CommitScanner> commit_scanner_;
148+ std::shared_ptr<FileStorePathFactory> path_factory_;
149+ std::string commit_user_;
150+ std::string table_name_;
124151 mutable LinkedHashMap<BinaryRow, bool > same_bucket_checked_partitions_;
125152};
126153
0 commit comments