Skip to content

Commit 20aaf37

Browse files
puzpuzpuzclaude
andcommitted
style(qwp): javadoc buildCrc32cTable; fix imprecise test msg (#64 m2)
Address the two cosmetic follow-ups from the #64 review: - buildCrc32cTable now uses a /** */ javadoc, matching its sibling private helpers crc32cRecovery/detectTornTail (was a // comment). - The payload-unbacked test asserted the frame-2 header "must end on the page boundary"; it actually ends 8 bytes below it (the asserted boundary-8 value, per the javadoc above). Reword to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9674fc5 commit 20aaf37

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,12 @@ private static int crc32cRecovery(long addr, long len) {
668668
return ~crc;
669669
}
670670

671-
// Standard reflected CRC-32C byte table (polynomial 0x82F63B78), matching
672-
// crc32c_table[0] in the native crc32c.c. Computed at class init to avoid
673-
// 256 hand-transcribed literals; drives crc32cRecovery.
671+
/**
672+
* Standard reflected CRC-32C byte table (polynomial {@code 0x82F63B78}),
673+
* matching {@code crc32c_table[0]} in the native {@code crc32c.c}. Computed
674+
* at class init to avoid 256 hand-transcribed literals; drives
675+
* {@link #crc32cRecovery}.
676+
*/
674677
private static int[] buildCrc32cTable() {
675678
int[] table = new int[256];
676679
for (int n = 0; n < 256; n++) {

core/src/test/java/io/questdb/client/test/cutlass/qwp/client/sf/cursor/MmapSegmentRecoveryFaultTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void testRecoverySurvivesPayloadReachingUnbackedPage() throws Exception {
162162
final int payloadLen1 = (int) (frame2Offset - MmapSegment.HEADER_SIZE - MmapSegment.FRAME_HEADER_SIZE);
163163

164164
long used = writeSegment(path, 11L, new int[]{payloadLen1, payloadLen2});
165-
assertEquals("frame 2's header must end on the page boundary", boundary - 8, frame2Offset + MmapSegment.FRAME_HEADER_SIZE);
165+
assertEquals("frame 2's header must end 8 bytes below the page boundary", boundary - 8, frame2Offset + MmapSegment.FRAME_HEADER_SIZE);
166166
assertTrue("frame 2 payload must reach past the boundary", used > boundary);
167167
punchSparseTail(path, boundary);
168168

0 commit comments

Comments
 (0)