You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2022/07/01 19:19:52 UTC

[arrow] branch master updated: ARROW-16941: [Java] Consolidate Dataset JNI compilation (#13481)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 9dac8ab776 ARROW-16941: [Java] Consolidate Dataset JNI compilation (#13481)
9dac8ab776 is described below

commit 9dac8ab776e6b2034a85e0978462c0b7ca23b7a5
Author: Larry White <lj...@gmail.com>
AuthorDate: Fri Jul 1 15:19:45 2022 -0400

    ARROW-16941: [Java] Consolidate Dataset JNI compilation (#13481)
    
    Moves the Dataset JNI C++ code from the arrow/cpp project to the arrow/java project, updating the CMakeLists.txt files as needed.
    
    Authored-by: Larry White <lw...@users.noreply.github.com>
    Signed-off-by: David Li <li...@gmail.com>
---
 cpp/CMakeLists.txt                                                  | 3 +++
 cpp/src/jni/CMakeLists.txt                                          | 4 ----
 {cpp/src/jni/dataset => java/dataset/src/main/cpp}/CMakeLists.txt   | 2 +-
 {cpp/src/jni/dataset => java/dataset/src/main/cpp}/jni_util.cc      | 2 +-
 {cpp/src/jni/dataset => java/dataset/src/main/cpp}/jni_util.h       | 0
 {cpp/src/jni/dataset => java/dataset/src/main/cpp}/jni_util_test.cc | 0
 {cpp/src/jni/dataset => java/dataset/src/main/cpp}/jni_wrapper.cc   | 2 +-
 7 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index f1b41cfacf..fc8f74db53 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -980,6 +980,9 @@ endif()
 
 if(ARROW_JNI)
   add_subdirectory(src/jni)
+  if(ARROW_DATASET)
+    add_subdirectory(../java/dataset/src/main/cpp ./java/jni)
+  endif()
 endif()
 
 if(ARROW_GANDIVA)
diff --git a/cpp/src/jni/CMakeLists.txt b/cpp/src/jni/CMakeLists.txt
index 3a5cc7fca8..835f58cd8f 100644
--- a/cpp/src/jni/CMakeLists.txt
+++ b/cpp/src/jni/CMakeLists.txt
@@ -21,7 +21,3 @@
 if(ARROW_ORC)
   add_subdirectory(orc)
 endif()
-
-if(ARROW_DATASET)
-  add_subdirectory(dataset)
-endif()
diff --git a/cpp/src/jni/dataset/CMakeLists.txt b/java/dataset/src/main/cpp/CMakeLists.txt
similarity index 97%
rename from cpp/src/jni/dataset/CMakeLists.txt
rename to java/dataset/src/main/cpp/CMakeLists.txt
index f3e309b614..6a0be9b7f5 100644
--- a/cpp/src/jni/dataset/CMakeLists.txt
+++ b/java/dataset/src/main/cpp/CMakeLists.txt
@@ -29,7 +29,7 @@ add_custom_target(arrow_dataset_jni)
 
 set(JNI_HEADERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
 
-add_subdirectory(../../../../java/dataset ./java)
+add_subdirectory(../../../../dataset ./java)
 
 set(ARROW_BUILD_STATIC OFF)
 
diff --git a/cpp/src/jni/dataset/jni_util.cc b/java/dataset/src/main/cpp/jni_util.cc
similarity index 99%
rename from cpp/src/jni/dataset/jni_util.cc
rename to java/dataset/src/main/cpp/jni_util.cc
index 8979c32710..e54dcba32b 100644
--- a/cpp/src/jni/dataset/jni_util.cc
+++ b/java/dataset/src/main/cpp/jni_util.cc
@@ -15,7 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "jni/dataset/jni_util.h"
+#include "./jni_util.h"
 
 #include <memory>
 #include <mutex>
diff --git a/cpp/src/jni/dataset/jni_util.h b/java/dataset/src/main/cpp/jni_util.h
similarity index 100%
rename from cpp/src/jni/dataset/jni_util.h
rename to java/dataset/src/main/cpp/jni_util.h
diff --git a/cpp/src/jni/dataset/jni_util_test.cc b/java/dataset/src/main/cpp/jni_util_test.cc
similarity index 100%
rename from cpp/src/jni/dataset/jni_util_test.cc
rename to java/dataset/src/main/cpp/jni_util_test.cc
diff --git a/cpp/src/jni/dataset/jni_wrapper.cc b/java/dataset/src/main/cpp/jni_wrapper.cc
similarity index 99%
rename from cpp/src/jni/dataset/jni_wrapper.cc
rename to java/dataset/src/main/cpp/jni_wrapper.cc
index 1e5c7a8aa7..9312825e28 100644
--- a/cpp/src/jni/dataset/jni_wrapper.cc
+++ b/java/dataset/src/main/cpp/jni_wrapper.cc
@@ -24,7 +24,7 @@
 #include "arrow/filesystem/localfs.h"
 #include "arrow/ipc/api.h"
 #include "arrow/util/iterator.h"
-#include "jni/dataset/jni_util.h"
+#include "./jni_util.h"
 #include "org_apache_arrow_dataset_file_JniWrapper.h"
 #include "org_apache_arrow_dataset_jni_JniWrapper.h"
 #include "org_apache_arrow_dataset_jni_NativeMemoryPool.h"