Browse Source

debug: track position and buffer state at close time

Added logging to show:
1. totalPosition: Total bytes ever written to stream
2. buffer.position(): Bytes still in buffer before flush
3. finalPosition: Position after flush completes

This will reveal if:
- Parquet wrote 1338 bytes → position should be 1338
- Only 1260 bytes reached write() → position would be 1260
- 78 bytes stuck in buffer → buffer.position() would be 78

Expected output:
  close: path=...parquet totalPosition=1338 buffer.position()=78
  → Shows 78 bytes in buffer need flushing

OR:
  close: path=...parquet totalPosition=1260 buffer.position()=0
  → Shows Parquet never wrote the 78 bytes!
pull/7526/head
chrislu 7 days ago
parent
commit
6a73f03000
  1. 3
      other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java

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

@ -191,10 +191,11 @@ public class SeaweedOutputStream extends OutputStream {
return;
}
LOG.debug("close path: {}", path);
LOG.info("close: path={} totalPosition={} buffer.position()={}", path, position, buffer.position());
try {
flushInternal();
threadExecutor.shutdown();
LOG.info("close completed: path={} finalPosition={}", path, position);
} finally {
lastError = new IOException("Stream is closed!");
ByteBufferPool.release(buffer);

Loading…
Cancel
Save