Skip to content

Core: Coalesce nearby blob reads in PuffinReader.readAll - #17418

Open
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:puffin-readall-coalesce
Open

Core: Coalesce nearby blob reads in PuffinReader.readAll#17418
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:puffin-readall-coalesce

Conversation

@vishnuprakaz

@vishnuprakaz vishnuprakaz commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

PuffinReader.readAll issues one seek and read per blob. This resolves the TODO from #4537 to coalesce nearby reads: Puffin stats/index blobs are written contiguously, so reading them in fewer requests cuts round trips, which matters most on object stores.

Contiguous and overlapping blobs are sorted by offset and read in a single request, returned as ByteBuffer views over the region without copying. A run is split once it would exceed a max read size, capped at 8 MiB (the MANIFEST_TARGET_SIZE default), which bounds the extra memory held versus per-blob reads; a blob larger than the cap is still read on its own. RangeReadable.readVectored was considered, but its default implementation does not coalesce on S3/Hadoop and buffers every range eagerly.

@github-actions github-actions Bot added the core label Jul 29, 2026
Resolve the TODO from apache#4537 by reading contiguous blobs in a single
  request, handed back as no-copy ByteBuffer views. A contiguous run is
  split into bounded reads (capped at MANIFEST_TARGET_SIZE, 8 MiB) so a
  large blob section never allocates one oversized buffer.
@vishnuprakaz
vishnuprakaz force-pushed the puffin-readall-coalesce branch from 8f46a60 to b663983 Compare July 29, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant