Browse Source

debug parquet footer writing

pull/7526/head
chrislu 5 days ago
parent
commit
1ca6d7f441
  1. 9
      other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java

9
other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java

@ -100,7 +100,8 @@ public class SeaweedOutputStream extends OutputStream {
public synchronized long getPos() { public synchronized long getPos() {
long currentPos = position + buffer.position(); long currentPos = position + buffer.position();
if (path.contains("parquet")) { if (path.contains("parquet")) {
LOG.info("[DEBUG-2024] 📍 getPos() called: flushedPosition={} bufferPosition={} returning={} totalBytesWritten={} writeCalls={}",
LOG.info(
"[DEBUG-2024] 📍 getPos() called: flushedPosition={} bufferPosition={} returning={} totalBytesWritten={} writeCalls={}",
position, buffer.position(), currentPos, totalBytesWritten, writeCallCount); position, buffer.position(), currentPos, totalBytesWritten, writeCallCount);
} }
return currentPos; return currentPos;
@ -173,12 +174,14 @@ public class SeaweedOutputStream extends OutputStream {
// Log significant writes AND writes near the end (potential footer) // Log significant writes AND writes near the end (potential footer)
if (path.contains("parquet")) { if (path.contains("parquet")) {
if (length >= 20) { if (length >= 20) {
LOG.info("[DEBUG-2024] ✍️ write({} bytes): totalSoFar={} writeCalls={} position={} bufferPos={}, file={}",
LOG.info(
"[DEBUG-2024] ✍️ write({} bytes): totalSoFar={} writeCalls={} position={} bufferPos={}, file={}",
length, totalBytesWritten, writeCallCount, position, buffer.position(), length, totalBytesWritten, writeCallCount, position, buffer.position(),
path.substring(path.lastIndexOf('/') + 1)); path.substring(path.lastIndexOf('/') + 1));
} else if (writeCallCount >= 220) { } else if (writeCallCount >= 220) {
// Log all small writes after call 220 (likely footer writes) // Log all small writes after call 220 (likely footer writes)
LOG.info("[DEBUG-2024] ✍️ write({} bytes): totalSoFar={} writeCalls={} position={} bufferPos={} [FOOTER?], file={}",
LOG.info(
"[DEBUG-2024] ✍️ write({} bytes): totalSoFar={} writeCalls={} position={} bufferPos={} [FOOTER?], file={}",
length, totalBytesWritten, writeCallCount, position, buffer.position(), length, totalBytesWritten, writeCallCount, position, buffer.position(),
path.substring(path.lastIndexOf('/') + 1)); path.substring(path.lastIndexOf('/') + 1));
} }

Loading…
Cancel
Save