Skip to content

Commit ac8166d

Browse files
mtopolnikclaude
andcommitted
Align RecoveryScan and PreadWindow ordering
RecoveryScan's constructor takes four same-typed longs, so its parameter order now matches the alphabetical field declaration order (baseSeq, frameCount, lastGood, tornTailBytes) to remove the positional-swap hazard; scanFile's call site follows. The nested classes also swap places so PreadWindow precedes RecoveryScan, keeping members alphabetically sorted per the repo convention. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 58bb7c8 commit ac8166d

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

  • core/src/main/java/io/questdb/client/cutlass/qwp/client/sf/cursor

core/src/main/java/io/questdb/client/cutlass/qwp/client/sf/cursor/MmapSegment.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -646,27 +646,12 @@ private static RecoveryScan scanFile(FilesFacade ff, int fd, String path, long f
646646
}
647647
}
648648
}
649-
return new RecoveryScan(baseSeq, pos, count, torn);
649+
return new RecoveryScan(baseSeq, count, pos, torn);
650650
} finally {
651651
Unsafe.free(buf, bufSize, MemoryTag.NATIVE_DEFAULT);
652652
}
653653
}
654654

655-
/** Result of {@link #scanFile}: header fields plus scan outcomes. */
656-
private static final class RecoveryScan {
657-
final long baseSeq;
658-
final long frameCount;
659-
final long lastGood;
660-
final long tornTailBytes;
661-
662-
RecoveryScan(long baseSeq, long lastGood, long frameCount, long tornTailBytes) {
663-
this.baseSeq = baseSeq;
664-
this.lastGood = lastGood;
665-
this.frameCount = frameCount;
666-
this.tornTailBytes = tornTailBytes;
667-
}
668-
}
669-
670655
/**
671656
* Sliding {@code pread} window over one file for the recovery scan.
672657
* {@link #require} repositions the window when the requested span is not
@@ -721,4 +706,19 @@ boolean require(long pos, int n) {
721706
return n <= got;
722707
}
723708
}
709+
710+
/** Result of {@link #scanFile}: header fields plus scan outcomes. */
711+
private static final class RecoveryScan {
712+
final long baseSeq;
713+
final long frameCount;
714+
final long lastGood;
715+
final long tornTailBytes;
716+
717+
RecoveryScan(long baseSeq, long frameCount, long lastGood, long tornTailBytes) {
718+
this.baseSeq = baseSeq;
719+
this.frameCount = frameCount;
720+
this.lastGood = lastGood;
721+
this.tornTailBytes = tornTailBytes;
722+
}
723+
}
724724
}

0 commit comments

Comments
 (0)