Skip to content

Commit

Permalink
[core] AppendOnlySplitGenerator skips the check of sequence number ov…
Browse files Browse the repository at this point in the history
…erlap in UNAWARE mode to reduce invalid logs.
  • Loading branch information
liming30 committed Nov 27, 2023
1 parent 385bd90 commit aac3d40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public AppendOnlyCompactManager(
CompactRewriter rewriter,
@Nullable CompactionMetrics metrics) {
this.executor = executor;
this.toCompact = new TreeSet<>(fileComparator());
this.toCompact = new TreeSet<>(fileComparator(false));
this.toCompact.addAll(restored);
this.minFileNum = minFileNum;
this.maxFileNum = maxFileNum;
Expand Down Expand Up @@ -304,13 +304,13 @@ public interface CompactRewriter {
* may be put after the new files, and this order will be disrupted. We need to ensure this
* order, so we force the order by sequence.
*/
public static Comparator<DataFileMeta> fileComparator() {
public static Comparator<DataFileMeta> fileComparator(boolean ignoreOverlap) {
return (o1, o2) -> {
if (o1 == o2) {
return 0;
}

if (isOverlap(o1, o2)) {
if (!ignoreOverlap && isOverlap(o1, o2)) {
LOG.warn(
String.format(
"There should no overlap in append files, but Range1(%s, %s), Range2(%s, %s),"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public AppendOnlySplitGenerator(
@Override
public List<List<DataFileMeta>> splitForBatch(List<DataFileMeta> input) {
List<DataFileMeta> files = new ArrayList<>(input);
files.sort(fileComparator());
files.sort(fileComparator(bucketMode == BucketMode.UNAWARE));
Function<DataFileMeta, Long> weightFunc = file -> Math.max(file.fileSize(), openFileCost);
return BinPacking.packForOrdered(files, weightFunc, targetSplitSize);
}
Expand Down

0 comments on commit aac3d40

Please sign in to comment.