Skip to content

Commit 671762a

Browse files
committed
[core] Extract ConflictDetection for FileStoreCommitImpl
1 parent 3bb082a commit 671762a

File tree

7 files changed

+577
-519
lines changed

7 files changed

+577
-519
lines changed

paimon-core/src/main/java/org/apache/paimon/AbstractFileStore.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.apache.paimon.operation.PartitionExpire;
4242
import org.apache.paimon.operation.SnapshotDeletion;
4343
import org.apache.paimon.operation.TagDeletion;
44+
import org.apache.paimon.operation.commit.ConflictDetection;
4445
import org.apache.paimon.partition.PartitionExpireStrategy;
4546
import org.apache.paimon.schema.SchemaManager;
4647
import org.apache.paimon.schema.TableSchema;
@@ -267,6 +268,16 @@ public FileStoreCommitImpl newCommit(String commitUser, FileStoreTable table) {
267268
if (snapshotCommit == null) {
268269
snapshotCommit = new RenamingSnapshotCommit(snapshotManager, Lock.empty());
269270
}
271+
ConflictDetection conflictDetection =
272+
new ConflictDetection(
273+
tableName,
274+
commitUser,
275+
partitionType,
276+
pathFactory(),
277+
newKeyComparator(),
278+
bucketMode(),
279+
options.deletionVectorsEnabled(),
280+
newIndexFileHandler());
270281
return new FileStoreCommitImpl(
271282
snapshotCommit,
272283
fileIO,
@@ -287,7 +298,6 @@ public FileStoreCommitImpl newCommit(String commitUser, FileStoreTable table) {
287298
options.manifestFullCompactionThresholdSize(),
288299
options.manifestMergeMinCount(),
289300
partitionType.getFieldCount() > 0 && options.dynamicPartitionOverwrite(),
290-
newKeyComparator(),
291301
options.branch(),
292302
newStatsFileHandler(),
293303
bucketMode(),
@@ -299,8 +309,7 @@ public FileStoreCommitImpl newCommit(String commitUser, FileStoreTable table) {
299309
options.commitMaxRetryWait(),
300310
options.commitStrictModeLastSafeSnapshot().orElse(null),
301311
options.rowTrackingEnabled(),
302-
options.deletionVectorsEnabled(),
303-
newIndexFileHandler());
312+
conflictDetection);
304313
}
305314

306315
@Override

0 commit comments

Comments
 (0)