You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "wangxinshuo-bolt (via GitHub)" <gi...@apache.org> on 2026/07/16 07:55:58 UTC
[PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
wangxinshuo-bolt opened a new pull request, #12535:
URL: https://github.com/apache/gluten/pull/12535
<!--
Thank you for submitting a pull request! Here are some tips:
1. For first-time contributors, please read our contributing guide:
https://github.com/apache/gluten/blob/main/CONTRIBUTING.md
2. If necessary, create a GitHub issue for discussion beforehand to avoid duplicate work.
3. If the PR is specific to a single backend, include [VL] or [CH] in the PR title to indicate the
Velox or ClickHouse backend, respectively.
4. If the PR is not ready for review, please mark it as a draft.
-->
## What changes are proposed in this pull request?
<!--
Provide a clear and concise description of the changes introduced in this PR.
Ensure the PR description aligns with the code changes, especially after updates.
If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the corresponding issue
when the PR is merged.
-->
## How was this patch tested?
<!--
Describe how the changes were tested, if applicable.
Include new tests to validate the functionality, if necessary.
For UI-related changes, attach screenshots to demonstrate the updates.
-->
## Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "jackylee-ch (via GitHub)" <gi...@apache.org>.
jackylee-ch commented on PR #12535:
URL: https://github.com/apache/gluten/pull/12535#issuecomment-5044372582
cc @zhztheplayer @zhouyuan
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3630212942
##########
cpp/core/compute/Runtime.h:
##########
@@ -190,6 +191,8 @@ class Runtime : public std::enable_shared_from_this<Runtime> {
return dumper_.get();
}
+ virtual std::unique_ptr<ColumnarBatchIterator> createJniInputIterator(const JniInputIteratorContext& context);
Review Comment:
`JniInputIteratorContext::env` is of type `JNIEnv*` which requires `jni.h`, while the Runtime API seems to be isolated from the JNI layer. Does it look like a design issue or so?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "wangxinshuo-bolt (via GitHub)" <gi...@apache.org>.
wangxinshuo-bolt commented on PR #12535:
URL: https://github.com/apache/gluten/pull/12535#issuecomment-5043588851
@jackylee-ch Can you review this PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "taiyang-li (via GitHub)" <gi...@apache.org>.
taiyang-li commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3619134331
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -566,7 +574,7 @@ Java_org_apache_gluten_vectorized_PlanEvaluatorJniWrapper_nativeCreateKernelWith
inputIters.reserve(itersLen);
for (int idx = 0; idx < itersLen; idx++) {
jobject iter = env->GetObjectArrayElement(batchItrArray, idx);
- auto arrayIter = std::make_unique<JniColumnarBatchIterator>(env, iter, ctx, idx);
+ auto arrayIter = ctx->createJniInputIterator({env, iter, idx});
Review Comment:
better use the style {.xxx=xxx, .xxx=xxx}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "zhouyuan (via GitHub)" <gi...@apache.org>.
zhouyuan commented on PR #12535:
URL: https://github.com/apache/gluten/pull/12535#issuecomment-5045747251
hi @wangxinshuo-bolt is this also part of refactor work in https://github.com/apache/gluten/issues/12456?
Cc: @marin-ma
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "wangxinshuo-bolt (via GitHub)" <gi...@apache.org>.
wangxinshuo-bolt commented on PR #12535:
URL: https://github.com/apache/gluten/pull/12535#issuecomment-5053993049
> hi @wangxinshuo-bolt is this also part of refactor work in #12456? Cc: @marin-ma
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "wangxinshuo-bolt (via GitHub)" <gi...@apache.org>.
wangxinshuo-bolt commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3594189162
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
+ return std::make_shared<::ShuffleStreamReader>(env, jShuffleStreamReader);
Review 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3630212942
##########
cpp/core/compute/Runtime.h:
##########
@@ -190,6 +191,8 @@ class Runtime : public std::enable_shared_from_this<Runtime> {
return dumper_.get();
}
+ virtual std::unique_ptr<ColumnarBatchIterator> createJniInputIterator(const JniInputIteratorContext& context);
Review Comment:
`JniInputIteratorContext::env` is of type `JNIEnv*` which requires `jni.h`, while the Runtime API is currently isolated from the JNI layer. Does it look like a design issue in the PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "wangxinshuo-bolt (via GitHub)" <gi...@apache.org>.
wangxinshuo-bolt commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3594163280
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
Review 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "taiyang-li (via GitHub)" <gi...@apache.org>.
taiyang-li commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3593856115
##########
cpp/core/tests/JniInputIteratorTest.cc:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jni/JniCommon.h"
+
+#include <gtest/gtest.h>
+
+using namespace gluten;
+
+namespace {
+
+class TestColumnarBatchIterator final : public ColumnarBatchIterator {
+ public:
+ std::shared_ptr<ColumnarBatch> next() override {
+ return nullptr;
+ }
+};
+
+class TestRuntime final : public Runtime {
+ public:
+ TestRuntime() : Runtime("jni-input-iterator-test", nullptr, nullptr, {}) {}
+
+ std::unique_ptr<ColumnarBatchIterator> createJniInputIterator(const JniInputIteratorContext& context) override {
+ env = context.env;
+ iterator = context.jColumnarBatchIterator;
+ iteratorIndex = context.iteratorIndex;
+ return std::make_unique<TestColumnarBatchIterator>();
+ }
+
+ JNIEnv* env{nullptr};
+ jobject iterator{nullptr};
+ int32_t iteratorIndex{-1};
+};
+
+TEST(JniInputIterator, DispatchesThroughRuntime) {
+ static int envMarker;
+ static int iteratorMarker;
+ auto* env = reinterpret_cast<JNIEnv*>(&envMarker);
+ auto iterator = reinterpret_cast<jobject>(&iteratorMarker);
+
+ TestRuntime runtime;
+ Runtime* baseRuntime = &runtime;
+ auto result = baseRuntime->createJniInputIterator({env, iterator, 7});
+
+ ASSERT_NE(result, nullptr);
+ EXPECT_EQ(runtime.env, env);
Review Comment:
The test logic here is basically transparent, see if it can be removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "taiyang-li (via GitHub)" <gi...@apache.org>.
taiyang-li commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3593881463
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
Review Comment:
why do we need to wrap it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Decouple JNI input adapters from Runtime [gluten]
Posted by "wangxinshuo-bolt (via GitHub)" <gi...@apache.org>.
wangxinshuo-bolt commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3638342814
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -238,45 +238,33 @@ void internalRuntimeReleaser(Runtime* runtime) {
delete runtime;
}
-class ShuffleStreamReader : public StreamReader {
- public:
- ShuffleStreamReader(JNIEnv* env, jobject reader) {
- if (env->GetJavaVM(&vm_) != JNI_OK) {
- throw GlutenException("Unable to get JavaVM instance");
- }
- ref_ = env->NewGlobalRef(reader);
- }
-
- ~ShuffleStreamReader() override {
- JNIEnv* env = nullptr;
- attachCurrentThreadAsDaemonOrThrow(vm_, &env);
- env->DeleteGlobalRef(ref_);
- }
+} // namespace
- std::shared_ptr<arrow::io::InputStream> readNextStream(arrow::MemoryPool* pool) override {
- JNIEnv* env = nullptr;
- attachCurrentThreadAsDaemonOrThrow(vm_, &env);
+namespace gluten {
- jobject jniIn = env->CallObjectMethod(ref_, shuffleStreamReaderNextStream);
- checkException(env);
- if (jniIn == nullptr) {
- return nullptr; // No more streams to read
- }
- std::shared_ptr<arrow::io::InputStream> in = std::make_shared<JavaInputStreamAdaptor>(env, pool, jniIn);
- return in;
+ShuffleStreamReader::ShuffleStreamReader(JNIEnv* env, jobject reader) {
Review Comment:
> The implementation should be placed in `JniCommon.cc`
ok. I will fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3630265537
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
Review Comment:
We don't need to keep it private. Would it make sense to move `ShuffleStreamReader` into `JniCommon.h`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3630276708
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
Review Comment:
We don't need to keep `ShuffleStreamReader` private. Would it make sense to move `ShuffleStreamReader` into JniCommon.h?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3638249601
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -238,45 +238,33 @@ void internalRuntimeReleaser(Runtime* runtime) {
delete runtime;
}
-class ShuffleStreamReader : public StreamReader {
- public:
- ShuffleStreamReader(JNIEnv* env, jobject reader) {
- if (env->GetJavaVM(&vm_) != JNI_OK) {
- throw GlutenException("Unable to get JavaVM instance");
- }
- ref_ = env->NewGlobalRef(reader);
- }
-
- ~ShuffleStreamReader() override {
- JNIEnv* env = nullptr;
- attachCurrentThreadAsDaemonOrThrow(vm_, &env);
- env->DeleteGlobalRef(ref_);
- }
+} // namespace
- std::shared_ptr<arrow::io::InputStream> readNextStream(arrow::MemoryPool* pool) override {
- JNIEnv* env = nullptr;
- attachCurrentThreadAsDaemonOrThrow(vm_, &env);
+namespace gluten {
- jobject jniIn = env->CallObjectMethod(ref_, shuffleStreamReaderNextStream);
- checkException(env);
- if (jniIn == nullptr) {
- return nullptr; // No more streams to read
- }
- std::shared_ptr<arrow::io::InputStream> in = std::make_shared<JavaInputStreamAdaptor>(env, pool, jniIn);
- return in;
+ShuffleStreamReader::ShuffleStreamReader(JNIEnv* env, jobject reader) {
Review Comment:
The implementation should be placed in `JniCommon.cc`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3630162953
##########
cpp/core/jni/JniCommon.cc:
##########
@@ -67,6 +67,12 @@ gluten::Runtime* gluten::getRuntime(JNIEnv* env, jobject runtimeAware) {
return ctx;
}
+std::unique_ptr<gluten::ColumnarBatchIterator> gluten::Runtime::createJniInputIterator(
+ const JniInputIteratorContext& context) {
+ return std::make_unique<JniColumnarBatchIterator>(
+ context.env, context.jColumnarBatchIterator, this, context.iteratorIndex);
+}
Review Comment:
Should this be defined in `Runtime.cc`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-12535][CORE] Support backend-specific JNI input adapters [gluten]
Posted by "taiyang-li (via GitHub)" <gi...@apache.org>.
taiyang-li merged PR #12535:
URL: https://github.com/apache/gluten/pull/12535
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "marin-ma (via GitHub)" <gi...@apache.org>.
marin-ma commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3630265537
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
Review Comment:
We don't need to keep it private. Would it make sense to move `ShuffleStreamReader` into `JniCommon.h`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "taiyang-li (via GitHub)" <gi...@apache.org>.
taiyang-li commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3593870061
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
+ return std::make_shared<::ShuffleStreamReader>(env, jShuffleStreamReader);
Review Comment:
remove "::"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [CORE] Add reusable JNI input adapters for backend runtimes [gluten]
Posted by "wangxinshuo-bolt (via GitHub)" <gi...@apache.org>.
wangxinshuo-bolt commented on code in PR #12535:
URL: https://github.com/apache/gluten/pull/12535#discussion_r3594197783
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -273,6 +273,14 @@ class ShuffleStreamReader : public StreamReader {
} // namespace
+namespace gluten {
+
+std::shared_ptr<StreamReader> makeShuffleStreamReader(JNIEnv* env, jobject jShuffleStreamReader) {
+ return std::make_shared<::ShuffleStreamReader>(env, jShuffleStreamReader);
Review Comment:
This is merely a defensive strategy intended to prevent misuse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org