[CORE] Add reusable JNI input adapters for backend runtimes#12535
Open
wangxinshuo-bolt wants to merge 2 commits into
Open
[CORE] Add reusable JNI input adapters for backend runtimes#12535wangxinshuo-bolt wants to merge 2 commits into
wangxinshuo-bolt wants to merge 2 commits into
Conversation
taiyang-li
reviewed
Jul 16, 2026
taiyang-li
reviewed
Jul 16, 2026
| namespace gluten { | ||
|
|
||
| std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) { | ||
| return std::make_shared<::ShuffleStreamReader>(env, jShuffleStreamReader); |
Contributor
Author
There was a problem hiding this comment.
remove "::"
::ClassName means: look for ClassName in the global namespace. It avoids name conflicts by explicitly referring to the class in the global namespace.
Contributor
Author
There was a problem hiding this comment.
This is merely a defensive strategy intended to prevent misuse.
taiyang-li
reviewed
Jul 16, 2026
|
|
||
| namespace gluten { | ||
|
|
||
| std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) { |
Contributor
There was a problem hiding this comment.
why do we need to wrap it.
Contributor
Author
There was a problem hiding this comment.
why do we need to wrap it.
ShuffleStreamReader is a private implementation within JniWrapper.cc; we need a function to expose the mechanism for creating ShuffleStreamReader instances for different backends.
wangxinshuo-bolt
force-pushed
the
pr/core-jni-backend-adapters
branch
from
July 16, 2026 09:30
bee9bdd to
c436dce
Compare
wangxinshuo-bolt
marked this pull request as ready for review
July 16, 2026 12:43
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.
What changes are proposed in this pull request?
This PR adds reusable JNI input-adapter extension points for backend runtimes.
Previously,
PlanEvaluatorJniWrapperalways createdJniColumnarBatchIteratordirectly. This prevented backends that require custom input handling from reusing the common plan-evaluation JNI workflow.This PR:
Runtime::createJniInputIterator()as an overridable factory, with a default implementation that preserves the existing behavior.JniInputIteratorContext.PlanEvaluatorJniWrapperto create input iterators through the runtime factory.makeShuffleStreamReader()so backends can reuse the common Java-to-native shuffle stream adapter.With these changes, a backend can customize JNI input handling without duplicating the common JNI wrapper logic.
How was this patch tested?
ColumnarBatchIteratorimplementation.Was this patch authored or co-authored using generative AI tooling?
Yes.
Generated-by: Codex GPT-5