Skip to content

feat(jni): make Java read coalescing configurable - #11369

Merged
robert3005 merged 3 commits into
vortex-data:developfrom
quantcast:cwirt/upstream-java-read-coalescing
Nov 10, 2026
Merged

robert3005 merged 3 commits into
vortex-data:developfrom
quantcast:cwirt/upstream-java-read-coalescing

Conversation

@ChristopherWirt

@ChristopherWirt ChristopherWirt commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Java-backed readers always use CoalesceConfig::object_storage() (a 1 MiB gap, a 16 MiB maximum merged span). Callers can't change it.

The right values depend on the storage underneath. Local SSD, spinning disk and object stores each trade request count against extra bytes read differently. This PR lets Java and Spark callers set them, keeping the current 1 MiB / 16 MiB as the defaults.

Changes

  • Add default NativeReadable.coalesceDistance() and coalesceMaxSize() methods. Native code reads them once, when it registers a scan or metadata/statistics source.
  • Add Spark read options vortex.read.coalesce.distance and vortex.read.coalesce.maxSize, in bytes. They're case-insensitive and validated before broadcast.
  • Validate the limits natively, leaving alignment headroom under Java's ByteBuffer capacity. Splitting a single read larger than that is a separate follow-up.
  • Document the options, and add Rust, JNI and Spark tests for validation, read-once behaviour and serialized settings.

API changes

Two default interface methods and two Spark read options. Existing implementations keep today's behaviour.

Validation

Maintainer action: please add changelog/feature. I don't have permission to set labels.

No tests, builds or lint were run on this branch. The same change was tested in our fork. No benchmarks were run.

AI assistance

AI tools helped write this change and its description. Christopher Wirt is the responsible contributor.

ChristopherWirt added a commit to quantcast/vortex that referenced this pull request Nov 10, 2026
Sets the default Java read coalescing gap back to 1 MiB, from the 64 KiB
#95 chose.

- Upstream's port (vortex-data#11369) keeps 1 MiB, so this keeps
our defaults the same as upstream's.
- Readers that want 64 KiB can still set
`vortex.read.coalesce.distance`.

Tested: `:vortex-spark-4.0_2.13:test --tests 'dev.vortex.spark.io.*'`
(28 passed).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@robert3005 robert3005 added the changelog/feature A new feature label Nov 10, 2026
@robert3005
robert3005 enabled auto-merge (squash) November 10, 2026 14:09
auto-merge was automatically disabled November 10, 2026 15:31

Head branch was pushed to by a user without write access

@robert3005
robert3005 enabled auto-merge (squash) November 10, 2026 15:36
@robert3005

Copy link
Copy Markdown
Contributor

I think you still have spotless issues here

auto-merge was automatically disabled November 10, 2026 16:34

Head branch was pushed to by a user without write access

@robert3005
robert3005 enabled auto-merge (squash) November 10, 2026 16:42
@robert3005
robert3005 merged commit 56108c8 into vortex-data:develop Nov 10, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Java-backed read coalescing configurable

2 participants