Skip to content

Commit b806157

Browse files
committed
fix comments
1 parent 99e4d0c commit b806157

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

paimon-common/src/main/java/org/apache/paimon/utils/RowRangeIndex.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ public List<Range> ranges() {
5555
return Collections.unmodifiableList(ranges);
5656
}
5757

58-
public boolean contains(long start, long end) {
59-
int candidate = lowerBound(ends, start);
60-
return candidate < starts.length && starts[candidate] <= start && ends[candidate] >= end;
61-
}
62-
63-
public boolean containsExactly(long start, long end) {
64-
int candidate = lowerBound(starts, start);
65-
return candidate < starts.length && starts[candidate] == start && ends[candidate] == end;
66-
}
67-
6858
public boolean intersects(long start, long end) {
6959
int candidate = lowerBound(ends, start);
7060
return candidate < starts.length && starts[candidate] <= end;
@@ -77,6 +67,13 @@ public boolean contains(Range range) {
7767
&& ends[candidate] >= range.to;
7868
}
7969

70+
public boolean containsExactly(Range range) {
71+
int candidate = lowerBound(starts, range.from);
72+
return candidate < starts.length
73+
&& starts[candidate] == range.from
74+
&& ends[candidate] == range.to;
75+
}
76+
8077
public List<Range> intersectedRanges(long start, long end) {
8178
int left = lowerBound(ends, start);
8279
if (left >= ranges.size()) {

paimon-core/src/main/java/org/apache/paimon/operation/commit/ConflictDetection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,11 @@ Optional<RuntimeException> checkRowIdExistence(
644644
RowRangeIndex existingIndex = RowRangeIndex.create(existingRanges, false);
645645

646646
for (SimpleFileEntry entry : filesToCheck) {
647-
long rowRangeEnd = entry.firstRowId() + entry.rowCount() - 1;
647+
Range rowRange = entry.nonNullRowIdRange();
648648
boolean exists =
649649
dedicatedStorageFile(entry.fileName())
650-
? existingIndex.contains(entry.firstRowId(), rowRangeEnd)
651-
: existingIndex.containsExactly(entry.firstRowId(), rowRangeEnd);
650+
? existingIndex.contains(rowRange)
651+
: existingIndex.containsExactly(rowRange);
652652
if (!exists) {
653653
return Optional.of(
654654
new RuntimeException(

0 commit comments

Comments
 (0)