feat(java): expose core reader tuning options in Java bindings - #8259
Open
jihuayu wants to merge 4 commits into
Open
feat(java): expose core reader tuning options in Java bindings#8259jihuayu wants to merge 4 commits into
jihuayu wants to merge 4 commits into
Conversation
Xuanwo
reviewed
Sep 9, 2026
| * @return a stream that the caller must close | ||
| * @throws OpenDALException if reader options are invalid (ConfigInvalid) or creation fails | ||
| */ | ||
| public OperatorInputStream createInputStream(String path, ReadOptions readOptions, ReaderOptions readerOptions) { |
Member
There was a problem hiding this comment.
ReadOptions overlaps ReaderOptions. It seems we should just accept ReaderOptions here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #8252.
Rationale for this change
Java input streams cannot configure the core reader’s chunking, concurrency, or prefetching. Exposing these controls separately from
ReadOptionskeeps reader execution settings distinct from the logical read range.Considering that ReadOptions and ReaderOptions are separate abstractions in OpenDAL, I think we should introduce a new ReaderOptions configuration in the Java binding instead of extending ReadOptions with reader-specific controls.
gapis not exposed because Java’sInputStreamuses the core’sinto_bytes_iterator(range)to read a single continuous range. The option only affects range merging inReader::fetch, which the Java binding does not currently expose.What changes are included in this PR?
ReaderOptionswithconcurrent,chunk,prefetch, andcontentLengthHint.createInputStream(path, readOptions, readerOptions)and map its execution settings to core options through JNI.Are there any user-facing changes?
Yes. Java callers can enable chunked reads by setting a positive
chunkand tune internal request concurrency and buffering. Settingconcurrentalone does not enable concurrent range reads.Existing overloads and constructors remain available with their default unchunked streaming behavior. Invalid reader option values produce
OpenDALExceptionwith codeConfigInvalidwhen the stream is created.AI Usage Statement
I used GPT-6 to complete the implementation and to write the tests and documentation. I personally reviewed all of the code.