Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ matrix:
env: ARROW_TEST_GROUP=integration
jdk: openjdk8
env:
- ARROW_TRAVIS_PLASMA=1
- ARROW_TRAVIS_PLASMA_JAVA_CLIENT=1
- CC="clang-6.0"
- CXX="clang++-6.0"
before_script:
Expand All @@ -141,6 +143,7 @@ matrix:
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_integration.sh
- $TRAVIS_BUILD_DIR/ci/travis_script_plasma_java_client.sh
# NodeJS
- language: node_js
os: linux
Expand Down
4 changes: 4 additions & 0 deletions ci/travis_before_script_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ if [ $ARROW_TRAVIS_PLASMA == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_PLASMA=ON"
fi

if [ $ARROW_TRAVIS_PLASMA_JAVA_CLIENT == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_PLASMA_JAVA_CLIENT=ON"
fi

if [ $ARROW_TRAVIS_ORC == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_ORC=ON"
fi
Expand Down
30 changes: 30 additions & 0 deletions ci/travis_script_plasma_java_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# 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.

set -e

PLASMA_JAVA_DIR=${TRAVIS_BUILD_DIR}/java/plasma

pushd $PLASMA_JAVA_DIR

mvn clean install
export PLASMA_STORE=${TRAVIS_BUILD_DIR}/cpp-install/bin/plasma_store
java -cp target/test-classes:target/classes -Djava.library.path=${TRAVIS_BUILD_DIR}/cpp-build/debug/ org.apache.arrow.plasma.PlasmaClientTest

popd
4 changes: 4 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
"Build the plasma object store along with Arrow"
OFF)

option(ARROW_PLASMA_JAVA_CLIENT
"Build the plasma object store java client"
OFF)

option(ARROW_USE_SSE
"Build with SSE4 optimizations"
OFF)
Expand Down
35 changes: 35 additions & 0 deletions cpp/src/plasma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,41 @@ install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/plasma.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")

if(ARROW_PLASMA_JAVA_CLIENT)
# Plasma java client support
find_package(JNI REQUIRED)
# add jni support
include_directories(${JAVA_INCLUDE_PATH})
include_directories(${JAVA_INCLUDE_PATH2})
if (JNI_FOUND)
message (STATUS "JNI_INCLUDE_DIRS = ${JNI_INCLUDE_DIRS}")
message (STATUS "JNI_LIBRARIES = ${JNI_LIBRARIES}")
else()
message (WARNING "Could not find JNI")
endif()

add_compile_options("-I$ENV{JAVA_HOME}/include/")
if(WIN32)
add_compile_options("-I$ENV{JAVA_HOME}/include/win32")
elseif(APPLE)
add_compile_options("-I$ENV{JAVA_HOME}/include/darwin")
else() # linux
add_compile_options("-I$ENV{JAVA_HOME}/include/linux")
endif()

include_directories("${CMAKE_CURRENT_LIST_DIR}/lib/java")

file(GLOB PLASMA_LIBRARY_EXT_java_SRC
lib/java/*.cc lib/*.cc)
add_library(plasma_java SHARED
${PLASMA_LIBRARY_EXT_java_SRC})

if(APPLE)
target_link_libraries(plasma_java plasma_static ${PLASMA_LINK_LIBS} "-undefined dynamic_lookup" -Wl,-force_load,${FLATBUFFERS_STATIC_LIB} ${FLATBUFFERS_STATIC_LIB} ${PTHREAD_LIBRARY})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the -Wl,-force_load, part here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Wl,-force_load for add runtime library path here

else(APPLE)
target_link_libraries(plasma_java plasma_static ${PLASMA_LINK_LIBS} -Wl,--whole-archive ${FLATBUFFERS_STATIC_LIB} -Wl,--no-whole-archive ${FLATBUFFERS_STATIC_LIB} ${PTHREAD_LIBRARY})
endif(APPLE)
endif()
#######################################
# Unit tests
#######################################
Expand Down
Loading