Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] Remove useless ctx variable #6348

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions cpp/core/jni/JniWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ JNIEXPORT jboolean JNICALL Java_org_apache_gluten_vectorized_ColumnarBatchOutIte
jobject wrapper,
jlong iterHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto iter = ObjectStore::retrieve<ResultIterator>(iterHandle);
if (iter == nullptr) {
std::string errorMessage =
Expand Down Expand Up @@ -438,8 +436,6 @@ JNIEXPORT jobject JNICALL Java_org_apache_gluten_vectorized_ColumnarBatchOutIter
jobject wrapper,
jlong iterHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto iter = ObjectStore::retrieve<ResultIterator>(iterHandle);
auto metrics = iter->getMetrics();
unsigned int numMetrics = 0;
Expand Down Expand Up @@ -499,8 +495,6 @@ JNIEXPORT jlong JNICALL Java_org_apache_gluten_vectorized_ColumnarBatchOutIterat
jlong iterHandle,
jlong size) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto it = ObjectStore::retrieve<ResultIterator>(iterHandle);
if (it == nullptr) {
std::string errorMessage = "Invalid result iter handle " + std::to_string(iterHandle);
Expand All @@ -515,8 +509,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_vectorized_ColumnarBatchOutIterato
jobject wrapper,
jlong iterHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

ObjectStore::release(iterHandle);
JNI_METHOD_END()
}
Expand All @@ -540,7 +532,6 @@ Java_org_apache_gluten_vectorized_NativeColumnarToRowJniWrapper_nativeColumnarTo
jlong c2rHandle,
jlong batchHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto columnarToRowConverter = ObjectStore::retrieve<ColumnarToRowConverter>(c2rHandle);
auto cb = ObjectStore::retrieve<ColumnarBatch>(batchHandle);
columnarToRowConverter->convert(cb);
Expand Down Expand Up @@ -569,8 +560,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_vectorized_NativeColumnarToRowJniW
jobject wrapper,
jlong c2rHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

ObjectStore::release(c2rHandle);
JNI_METHOD_END()
}
Expand Down Expand Up @@ -614,8 +603,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_vectorized_NativeRowToColumnarJniW
jobject wrapper,
jlong r2cHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

ObjectStore::release(r2cHandle);
JNI_METHOD_END()
}
Expand All @@ -625,7 +612,6 @@ JNIEXPORT jstring JNICALL Java_org_apache_gluten_columnarbatch_ColumnarBatchJniW
jobject wrapper,
jlong batchHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto batch = ObjectStore::retrieve<ColumnarBatch>(batchHandle);
return env->NewStringUTF(batch->getType().c_str());
JNI_METHOD_END(nullptr)
Expand All @@ -636,7 +622,6 @@ JNIEXPORT jlong JNICALL Java_org_apache_gluten_columnarbatch_ColumnarBatchJniWra
jobject wrapper,
jlong batchHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto batch = ObjectStore::retrieve<ColumnarBatch>(batchHandle);
return batch->numBytes();
JNI_METHOD_END(kInvalidObjectHandle)
Expand All @@ -647,7 +632,6 @@ JNIEXPORT jlong JNICALL Java_org_apache_gluten_columnarbatch_ColumnarBatchJniWra
jobject wrapper,
jlong batchHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto batch = ObjectStore::retrieve<ColumnarBatch>(batchHandle);
return batch->numColumns();
JNI_METHOD_END(kInvalidObjectHandle)
Expand All @@ -658,7 +642,6 @@ JNIEXPORT jlong JNICALL Java_org_apache_gluten_columnarbatch_ColumnarBatchJniWra
jobject wrapper,
jlong batchHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto batch = ObjectStore::retrieve<ColumnarBatch>(batchHandle);
return batch->numRows();
JNI_METHOD_END(kInvalidObjectHandle)
Expand Down Expand Up @@ -692,7 +675,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_columnarbatch_ColumnarBatchJniWrap
jlong cSchema,
jlong cArray) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto batch = ObjectStore::retrieve<ColumnarBatch>(batchHandle);
std::shared_ptr<ArrowSchema> exportedSchema = batch->exportArrowSchema();
std::shared_ptr<ArrowArray> exportedArray = batch->exportArrowArray();
Expand Down Expand Up @@ -755,7 +737,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_columnarbatch_ColumnarBatchJniWrap
jobject wrapper,
jlong batchHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
ObjectStore::release(batchHandle);
JNI_METHOD_END()
}
Expand Down Expand Up @@ -900,8 +881,6 @@ JNIEXPORT jlong JNICALL Java_org_apache_gluten_vectorized_ShuffleWriterJniWrappe
jlong size,
jboolean callBySelf) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto shuffleWriter = ObjectStore::retrieve<ShuffleWriter>(shuffleWriterHandle);
if (!shuffleWriter) {
std::string errorMessage = "Invalid shuffle writer handle " + std::to_string(shuffleWriterHandle);
Expand All @@ -922,8 +901,6 @@ JNIEXPORT jlong JNICALL Java_org_apache_gluten_vectorized_ShuffleWriterJniWrappe
jlong batchHandle,
jlong memLimit) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto shuffleWriter = ObjectStore::retrieve<ShuffleWriter>(shuffleWriterHandle);
if (!shuffleWriter) {
std::string errorMessage = "Invalid shuffle writer handle " + std::to_string(shuffleWriterHandle);
Expand All @@ -943,8 +920,6 @@ JNIEXPORT jobject JNICALL Java_org_apache_gluten_vectorized_ShuffleWriterJniWrap
jobject wrapper,
jlong shuffleWriterHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto shuffleWriter = ObjectStore::retrieve<ShuffleWriter>(shuffleWriterHandle);
if (!shuffleWriter) {
std::string errorMessage = "Invalid shuffle writer handle " + std::to_string(shuffleWriterHandle);
Expand Down Expand Up @@ -985,8 +960,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_vectorized_ShuffleWriterJniWrapper
jobject wrapper,
jlong shuffleWriterHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

ObjectStore::release(shuffleWriterHandle);
JNI_METHOD_END()
}
Expand Down Expand Up @@ -1053,8 +1026,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_vectorized_ShuffleReaderJniWrapper
jlong shuffleReaderHandle,
jobject metrics) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto reader = ObjectStore::retrieve<ShuffleReader>(shuffleReaderHandle);
env->CallVoidMethod(metrics, shuffleReaderMetricsSetDecompressTime, reader->getDecompressTime());
env->CallVoidMethod(metrics, shuffleReaderMetricsSetDeserializeTime, reader->getDeserializeTime());
Expand All @@ -1068,8 +1039,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_vectorized_ShuffleReaderJniWrapper
jobject wrapper,
jlong shuffleReaderHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto reader = ObjectStore::retrieve<ShuffleReader>(shuffleReaderHandle);
GLUTEN_THROW_NOT_OK(reader->close());
ObjectStore::release(shuffleReaderHandle);
Expand Down Expand Up @@ -1111,8 +1080,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_datasource_DatasourceJniWrapper_in
jlong dsHandle,
jlong cSchema) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto datasource = ObjectStore::retrieve<Datasource>(dsHandle);
datasource->inspectSchema(reinterpret_cast<struct ArrowSchema*>(cSchema));
JNI_METHOD_END()
Expand All @@ -1123,8 +1090,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_datasource_DatasourceJniWrapper_cl
jobject wrapper,
jlong dsHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

auto datasource = ObjectStore::retrieve<Datasource>(dsHandle);
datasource->close();
ObjectStore::release(dsHandle);
Expand Down Expand Up @@ -1252,8 +1217,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_vectorized_ColumnarBatchSerializer
jobject wrapper,
jlong serializerHandle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);

ObjectStore::release(serializerHandle);
JNI_METHOD_END()
}
Expand Down
4 changes: 0 additions & 4 deletions cpp/velox/jni/VeloxJniWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_utils_VeloxBloomFilterJniWrapper_i
jlong handle,
jlong item) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto filter = gluten::ObjectStore::retrieve<velox::BloomFilter<std::allocator<uint64_t>>>(handle);
GLUTEN_CHECK(filter->isSet(), "Bloom-filter is not initialized");
filter->insert(folly::hasher<int64_t>()(item));
Expand All @@ -197,7 +196,6 @@ JNIEXPORT jboolean JNICALL Java_org_apache_gluten_utils_VeloxBloomFilterJniWrapp
jlong handle,
jlong item) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto filter = gluten::ObjectStore::retrieve<velox::BloomFilter<std::allocator<uint64_t>>>(handle);
GLUTEN_CHECK(filter->isSet(), "Bloom-filter is not initialized");
bool out = filter->mayContain(folly::hasher<int64_t>()(item));
Expand All @@ -222,7 +220,6 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_utils_VeloxBloomFilterJniWrapper_m
jlong handle,
jlong other) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto to = gluten::ObjectStore::retrieve<velox::BloomFilter<std::allocator<uint64_t>>>(handle);
auto from = gluten::ObjectStore::retrieve<velox::BloomFilter<std::allocator<uint64_t>>>(other);
GLUTEN_CHECK(to->isSet(), "Bloom-filter is not initialized");
Expand All @@ -237,7 +234,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_apache_gluten_utils_VeloxBloomFilterJniWra
jobject wrapper,
jlong handle) {
JNI_METHOD_START
auto ctx = gluten::getRuntime(env, wrapper);
auto filter = gluten::ObjectStore::retrieve<velox::BloomFilter<std::allocator<uint64_t>>>(handle);
GLUTEN_CHECK(filter->isSet(), "Bloom-filter is not initialized");
std::vector<char> buffer = serialize(filter.get());
Expand Down
Loading