jinchengchenghh commented on code in PR #10499:
URL:
https://github.com/apache/incubator-gluten/pull/10499#discussion_r2309600475
##########
cpp/core/shuffle/ShuffleReader.h:
##########
@@ -21,18 +21,25 @@
namespace gluten {
+class ShuffleReader;
Review Comment:
Why need this line?
##########
backends-velox/src/main/scala/org/apache/gluten/vectorized/ColumnarBatchSerializer.scala:
##########
@@ -68,16 +69,21 @@ class ColumnarBatchSerializer(
override def supportsRelocationOfSerializedObjects: Boolean = true
}
-private class ColumnarBatchSerializerInstance(
+private class ColumnarBatchSerializerInstanceImpl(
schema: StructType,
readBatchNumRows: SQLMetric,
numOutputRows: SQLMetric,
deserializeTime: SQLMetric,
decompressTime: SQLMetric,
shuffleWriterType: ShuffleWriterType)
- extends SerializerInstance
+ extends ColumnarBatchSerializerInstance
with Logging {
+ private val runtime =
Review Comment:
If the runtime is only used to construct ShuffleReaderJniWrapper, do not
create it here, wrap in jniWrapper
##########
cpp/velox/utils/TestStreamReader.h:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include "shuffle/ShuffleReader.h"
+#include "shuffle/ShuffleWriter.h"
+
+namespace gluten {
+
+class TestStreamReader : public StreamReader {
Review Comment:
Maybe add a library to move code only used for tests and benchmarks out of
the production source code.
##########
cpp/core/jni/JniWrapper.cc:
##########
@@ -190,6 +193,40 @@ void internalRuntimeReleaser(Runtime* runtime) {
delete runtime;
}
+class ShuffleStreamReader : public StreamReader {
+ public:
+ ShuffleStreamReader(JNIEnv* env, jobject reader) {
+ if (env->GetJavaVM(&vm_) != JNI_OK) {
+ std::string errorMessage = "Unable to get JavaVM instance";
Review Comment:
throw GlutenException("Unable to get JavaVM instance")
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]