diff --git a/hbase-native-client/CMakeLists.txt b/hbase-native-client/CMakeLists.txt new file mode 100644 index 000000000000..a497efe0fbb8 --- /dev/null +++ b/hbase-native-client/CMakeLists.txt @@ -0,0 +1,188 @@ +# 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. +# +cmake_minimum_required(VERSION 3.0) +PROJECT(hbaseclient CXX) +set(PROJECT_NAME "hbaseclient") +set(PROJECT_VERSION_MAJOR 0) +set(PROJECT_VERSION_MINOR 1 ) +set(PROJECT_VERSION_PATCH 0) +set(BUILD_SHARED_LIBS ON) +## set our cmake module path +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +## include the Protobuf generation code +include(ProtobufGen) +if(COMPILER_SUPPORTS_CXX14) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") +else() + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.") +endif() +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(HBASE_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/hbase") +set(HBASE_PROTO_GEN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/hbase/if") +set(HBASE_PROTO_GEN_INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/hbase/if") +# Set the right openssl root path +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl/") +else() + set(OPENSSL_ROOT_DIR "/usr/lib/x86_64-linux-gnu") +endif() +# Include OpenSSL +find_package (OpenSSL REQUIRED) +if (OPENSSL_FOUND) + include_directories(${OPENSSL_INCLUDE_DIR}) +else () + message( FATAL_ERROR "OpenSSL was not found. Please install OpenSSL" ) +endif (OPENSSL_FOUND) +# ensure we have required dependencies +find_package(Threads) +find_package(Boost REQUIRED COMPONENTS thread system filesystem) +find_package(Gflags REQUIRED) +find_package(Folly REQUIRED) +find_package(Krb5 REQUIRED) +find_package(Sasl2 REQUIRED) +find_package(Wangle REQUIRED) +find_package(GTest) +find_package(Glog) +find_package(Java REQUIRED) +find_package(JNI REQUIRED) +find_package(Zookeeper REQUIRED) +find_package(Protobuf REQUIRED) +if (NOT FOLLY_FOUND) + message(FATAL_ERROR "-- Folly not found") +endif() +if (NOT WANGLE_FOUND) + message(FATAL_ERROR "-- Wangle not found") +endif() +if (NOT PROTOBUF_FOUND) + message(FATAL_ERROR "-- Protocol buffer include directory not found ${PROTOBUF_INCLUDE_DIRS}") +endif() +if (NOT JNI_FOUND) + message(FATAL_ERROR "-- JAVA include directory not found") +endif() +### provide the include directories, starting at the base +### and including those from our +include_directories(include) +include_directories(${PROTOBUF_INCLUDE_DIRS}) +include_directories(${Zookeeper_INCLUDE_DIRS}) +include_directories(${Boost_INCLUDE_DIR}) +include_directories(${KRB5_INCLUDE_DIRS}) +include_directories(${JAVA_INCLUDE_DIRS}) +include_directories(${FOLLY_INCLUDE_DIRS}) +### create a directory for the hbase protobuf headers. +### this is helpful so that when we include it, later, we can generate +### the protocol buffer source/headers without polluting our tree. +set(CMAKE_BINARY_DIR_GEN "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/hbase/if/") +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR_GEN}) +## build a recursive list of sources +file(GLOB_RECURSE CONNECTION_SRC "${HBASE_SRC_DIR}/connection/*.cc" ) +file(GLOB_RECURSE EXCEPTION_SRC "${HBASE_SRC_DIR}/exceptions/*.cc" ) +file(GLOB_RECURSE PROTO_SRC "${HBASE_SRC_DIR}/if/*.cc" ) +file(GLOB_RECURSE UTILS_SRC "${HBASE_SRC_DIR}/utils/*.cc" ) +file(GLOB_RECURSE CLIENT_SRC "${HBASE_SRC_DIR}/client/*.cc" ) +file(GLOB_RECURSE SECURITY_SRC "${HBASE_SRC_DIR}/security/*.cc" ) +file(GLOB_RECURSE SRDE_SRC "${HBASE_SRC_DIR}/serde/*.cc" ) +file(GLOB_RECURSE TEST_UTIL "${HBASE_SRC_DIR}/test-util/*.cc" ) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}) +include_directories(${SASL_INCLUDE_DIRS}) +include_directories(${GFLAGS_INCLUDE_DIR}) +file(GLOB_RECURSE PROTO_FILES "${HBASE_SRC_DIR}/if/*.proto" ) +### generate the protocol buffers. +generate_protobuf_src(PROTO_SOURCES PROTO_HEADERS ${PROTO_FILES}) + + +add_library(hbaseclient-static STATIC ${PROTO_SOURCES} ${CLIENT_SRC} ${CONNECTION_SRC} ${EXCEPTION_SRC} ${PROTO_SRC} ${SECURITY_SRC} ${SRDE_SRC} ${UTILS_SRC}) +set_target_properties(hbaseclient-static PROPERTIES LINKER_LANGUAGE CXX) +SET_TARGET_PROPERTIES(hbaseclient-static PROPERTIES OUTPUT_NAME hbaseclient CLEAN_DIRECT_OUTPUT 1) +target_link_libraries(hbaseclient-static ${PROTOBUF_LIBRARY}) +target_link_libraries(hbaseclient-static ${FOLLY_LIBRARIES}) +target_link_libraries(hbaseclient-static ${Boost_LIBRARIES}) +target_link_libraries(hbaseclient-static ${SASL_LIBS}) +target_link_libraries(hbaseclient-static ${GLOG_SHARED_LIB}) +target_link_libraries(hbaseclient-static ${GFLAGS_SHARED_LIB}) +target_link_libraries(hbaseclient-static ${KRB5_LIBRARIES}) +target_link_libraries(hbaseclient-static ${WANGLE_LIBRARIES}) +target_link_libraries(hbaseclient-static ${Zookeeper_LIBRARIES}) +target_link_libraries(hbaseclient-static ${OPENSSL_LIBRARIES}) +add_library(hbaseclient-shared SHARED ${PROTO_SOURCES} ${CLIENT_SRC} ${CONNECTION_SRC} ${EXCEPTION_SRC} ${PROTO_SRC} ${SECURITY_SRC} ${SRDE_SRC} ${UTILS_SRC}) +set_target_properties(hbaseclient-shared PROPERTIES LINKER_LANGUAGE CXX) +SET_TARGET_PROPERTIES(hbaseclient-shared PROPERTIES COMPILE_FLAGS " -fPIC") +SET_TARGET_PROPERTIES(hbaseclient-shared PROPERTIES OUTPUT_NAME hbaseclient CLEAN_DIRECT_OUTPUT 1) +target_link_libraries(hbaseclient-shared ${PROTOBUF_LIBRARY}) +target_link_libraries(hbaseclient-shared ${FOLLY_LIBRARIES}) +target_link_libraries(hbaseclient-shared ${Boost_LIBRARIES}) +target_link_libraries(hbaseclient-shared ${SASL_LIBS}) +target_link_libraries(hbaseclient-shared ${GLOG_SHARED_LIB}) +target_link_libraries(hbaseclient-shared ${GFLAGS_SHARED_LIB}) +target_link_libraries(hbaseclient-shared ${KRB5_LIBRARIES}) +target_link_libraries(hbaseclient-shared ${WANGLE_LIBRARIES}) +target_link_libraries(hbaseclient-shared ${Zookeeper_LIBRARIES}) +add_executable(simple-client "${HBASE_SRC_DIR}/examples/simple-client.cc") +SET_TARGET_PROPERTIES(simple-client PROPERTIES COMPILE_FLAGS " ") +target_link_libraries(simple-client ${PROTOBUF_LIBRARY}) +target_link_libraries(simple-client ${Boost_LIBRARIES}) +target_link_libraries(simple-client ${SASL_LIBS}) +target_link_libraries(simple-client ${GFLAGS_SHARED_LIB}) +target_link_libraries(simple-client ${KRB5_LIBRARIES}) +target_link_libraries(simple-client ${Zookeeper_LIBRARIES}) +target_link_libraries(simple-client hbaseclient-static ${CMAKE_THREAD_LIBS_INIT}) +add_executable(load-client "${HBASE_SRC_DIR}/examples/load-client.cc") +SET_TARGET_PROPERTIES(load-client PROPERTIES COMPILE_FLAGS " ") +target_link_libraries(load-client ${PROTOBUF_LIBRARY}) +target_link_libraries(load-client ${Boost_LIBRARIES}) +target_link_libraries(load-client ${SASL_LIBS}) +target_link_libraries(load-client ${GFLAGS_SHARED_LIB}) +target_link_libraries(load-client ${KRB5_LIBRARIES}) +target_link_libraries(load-client ${Zookeeper_LIBRARIES}) +target_link_libraries(load-client hbaseclient-static ${CMAKE_THREAD_LIBS_INIT}) +if (JNI_FOUND) + message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") + message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}") +endif() +if (NOT SKIP_TESTS) + include(BuildTests) +endif() +## Create a custom target for our linter +add_custom_target( + linter + COMMAND ${CMAKE_SOURCE_DIR}/bin/cpplint.sh) + +# Install library headers +include(GNUInstallDirs) +file(GLOB RECURSE HEADERS include/*.h) +set_target_properties(hbaseclient-static PROPERTIES PUBLIC_HEADER "${HEADERS}") +install(TARGETS hbaseclient-static + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/ + COMPONENT LIBRARY ) +install(TARGETS hbaseclient-shared + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION include/ + COMPONENT LIBRARY ) +INSTALL ( + DIRECTORY ${CMAKE_SOURCE_DIR}/include/ + DESTINATION include/ + FILES_MATCHING PATTERN "*.h*") +# Install pb-generated headers too + INSTALL ( + DIRECTORY "${CMAKE_BINARY_DIR_GEN}" + DESTINATION include/hbase/if + FILES_MATCHING PATTERN "hbase/if/*.h") diff --git a/hbase-native-client/bin/cpplint.sh b/hbase-native-client/bin/cpplint.sh index 7a27945d7a37..497ab24f075f 100755 --- a/hbase-native-client/bin/cpplint.sh +++ b/hbase-native-client/bin/cpplint.sh @@ -16,9 +16,10 @@ # See the License for the specific language governing permissions and # limitations under the License. IFS=$'\n\t' - +OUTPUT_DIR=$1 +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CPPLINT_LOC=https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py -OUTPUT=build/cpplint.py +OUTPUT=$OUTPUT_DIR/cpplint.py declare -a MODULES=( client connection exceptions security serde utils test-util ) @@ -31,9 +32,9 @@ wget -nc $CPPLINT_LOC -O $OUTPUT # build/c++11 (We are building with c++14) for m in ${MODULES[@]}; do if [ $m != "security" ]; then #These are empty - exec find src/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100 + exec find ${SCRIPT_DIR}/../src/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100 fi if [ $m != "test-util" ]; then - exec find include/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100 + exec find ${SCRIPT_DIR}/../include/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100 fi done diff --git a/hbase-native-client/cmake/BuildTests.cmake b/hbase-native-client/cmake/BuildTests.cmake new file mode 100644 index 000000000000..27122560f7ea --- /dev/null +++ b/hbase-native-client/cmake/BuildTests.cmake @@ -0,0 +1,80 @@ +# 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. +### test functions +MACRO(GETSOURCEFILES result curdir) + FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) + SET(dirlist "") + FOREACH(child ${children}) + IF( "${child}" MATCHES ^[^.].*\\.cc) + + LIST(APPEND dirlist ${child}) + ENDIF() + ENDFOREACH() + SET(${result} ${dirlist}) +ENDMACRO() +find_package(GMock REQUIRED) +add_library(testutil STATIC ${TEST_UTIL}) +target_include_directories(testutil PRIVATE BEFORE "include") +target_include_directories(testutil PRIVATE BEFORE "${Java_INCLUDE_DIRS}") +target_include_directories(testutil PRIVATE BEFORE "${JNI_INCLUDE_DIRS}") +target_include_directories(testutil PRIVATE BEFORE "${Boost_INCLUDE_DIR}") +target_include_directories(testutil PRIVATE BEFORE "${GTEST_INCLUDE_DIRS}") +target_include_directories(testutil PRIVATE BEFORE${PROTOBUF_INCLUDE_DIRS}) +target_include_directories(testutil PRIVATE BEFORE${Zookeeper_INCLUDE_DIRS}) +target_include_directories(testutil PRIVATE BEFORE${KRB5_INCLUDE_DIRS}) +target_include_directories(testutil PRIVATE BEFORE${Java_INCLUDE_DIRS}) +target_include_directories(testutil PRIVATE BEFORE${FOLLY_INCLUDE_DIRS}) +target_link_libraries(testutil hbaseclient-static ${CMAKE_THREAD_LIBS_INIT} ${Java_LIBRARIES} ${JNI_LIBRARIES} ${PROTOBUF_LIBRARY} ${Boost_LIBRARIES} ${GFLAGS_SHARED_LIB} ${GMOCK_SHARED_LIB} ${GTEST_BOTH_LIBRARIES} ${SASL_LIBS} ${GFLAGS_SHARED_LIB} ${KRB5_LIBRARIES} ${OPENSSL_LIBRARIES} ${Zookeeper_LIBRARIES}) +function(createTests testName) + message ("-- Including Test: ${testName}") + target_include_directories(${testName} PRIVATE BEFORE "include") + target_include_directories(${testName} PRIVATE BEFORE "${Java_INCLUDE_DIRS}") + target_include_directories(${testName} PRIVATE BEFORE "${JNI_INCLUDE_DIRS}") + target_include_directories(${testName} PRIVATE BEFORE "${Boost_INCLUDE_DIR}") + target_include_directories(${testName} PRIVATE BEFORE "${GTEST_INCLUDE_DIRS}") + target_include_directories(${testName} PRIVATE BEFORE "${OPENSSL_INCLUDE_DIR}") + + target_link_libraries(hbaseclient-static ${PROTOBUF_LIBRARY}) + target_link_libraries(hbaseclient-static ${FOLLY_LIBRARIES}) + + target_link_libraries(${testName} hbaseclient-static testutil ${CMAKE_THREAD_LIBS_INIT} + ${Java_LIBRARIES} + ${JNI_LIBRARIES} + ${PROTOBUF_LIBRARY} + ${Boost_LIBRARIES} + ${GFLAGS_SHARED_LIB} + ${GTEST_BOTH_LIBRARIES} + ${SASL_LIBS} + ${GFLAGS_SHARED_LIB} + ${KRB5_LIBRARIES} + ${Zookeeper_LIBRARIES} ${OPENSSL_LIBRARIES} + ${WANGLE_LIBRARIES} + ${FOLLY_LIBRARIES} + ${GLOG_SHARED_LIB}) +endfunction() +enable_testing(test) +SET(TEST_DIR ${CMAKE_SOURCE_DIR}/src/test) +GETSOURCEFILES(UNIT_TESTS "${TEST_DIR}") +SET(UNIT_TEST_COUNT 0) +FOREACH(testfile ${UNIT_TESTS}) + get_filename_component(testfilename "${testfile}" NAME_WE) + add_executable("${testfilename}" "${TEST_DIR}/${testfile}") + createTests("${testfilename}") + MATH(EXPR UNIT_TEST_COUNT "${UNIT_TEST_COUNT}+1") + add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR}) +ENDFOREACH() +message("-- Finished building ${UNIT_TEST_COUNT} unit test file(s)...") diff --git a/hbase-native-client/cmake/FindFolly.cmake b/hbase-native-client/cmake/FindFolly.cmake new file mode 100644 index 000000000000..e7854a00c11f --- /dev/null +++ b/hbase-native-client/cmake/FindFolly.cmake @@ -0,0 +1,48 @@ +# 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. +# +find_path(FOLLY_ROOT_DIR + NAMES include/folly/AtomicHashMap.h +) +find_library(FOLLY_LIBRARIES + NAMES folly + HINTS ${FOLLY_ROOT_DIR}/lib /usr/lib/ /usr/local/lib/ /usr/lib/x86_64-linux-gnu/ +) +find_library(FOLLY_BENCHMARK_LIBRARIES + NAMES follybenchmark + HINTS ${FOLLY_ROOT_DIR}/lib +) +find_path(FOLLY_INCLUDE_DIR + NAMES folly/AtomicHashMap.h + HINTS ${FOLLY_ROOT_DIR}/include +) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Folly DEFAULT_MSG + FOLLY_LIBRARIES + FOLLY_INCLUDE_DIR +) +mark_as_advanced( + FOLLY_ROOT_DIR + FOLLY_LIBRARIES + FOLLY_BENCHMARK_LIBRARIES + FOLLY_INCLUDE_DIR +) +if (FOLLY_LIBRARIES) + set(FOLLY_FOUND "true") + message("-- Folly found, ${FOLLY_LIBRARIES}") +endif(FOLLY_LIBRARIES) diff --git a/hbase-native-client/cmake/FindGMock.cmake b/hbase-native-client/cmake/FindGMock.cmake new file mode 100644 index 000000000000..998fa6d2e324 --- /dev/null +++ b/hbase-native-client/cmake/FindGMock.cmake @@ -0,0 +1,23 @@ +# 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. +find_path(GMOCK_INCLUDE_DIR gmock/gmock.h) + # make sure we don't accidentally pick up a different version +find_library(GMOCK_SHARED_LIB gmock) +find_library(GMOCK_STATIC_LIB libgmock.a) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GMOCK REQUIRED_VARS + GMOCK_SHARED_LIB GMOCK_STATIC_LIB GMOCK_INCLUDE_DIR) diff --git a/hbase-native-client/cmake/FindGflags.cmake b/hbase-native-client/cmake/FindGflags.cmake new file mode 100644 index 000000000000..59c65df600bf --- /dev/null +++ b/hbase-native-client/cmake/FindGflags.cmake @@ -0,0 +1,23 @@ +# 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. +find_path(GFLAGS_INCLUDE_DIR gflags/gflags.h) + # make sure we don't accidentally pick up a different version +find_library(GFLAGS_SHARED_LIB gflags) +find_library(GFLAGS_STATIC_LIB libgflags.a) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFLAGS REQUIRED_VARS + GFLAGS_SHARED_LIB GFLAGS_STATIC_LIB GFLAGS_INCLUDE_DIR) diff --git a/hbase-native-client/cmake/FindGlog.cmake b/hbase-native-client/cmake/FindGlog.cmake new file mode 100644 index 000000000000..a2c541db7041 --- /dev/null +++ b/hbase-native-client/cmake/FindGlog.cmake @@ -0,0 +1,23 @@ +# 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. +find_path(GLOG_INCLUDE_DIR glog/logging.h) + # make sure we don't accidentally pick up a different version +find_library(GLOG_SHARED_LIB glog) +find_library(GLOG_STATIC_LIB libglog.a) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLOG REQUIRED_VARS + GLOG_SHARED_LIB GLOG_STATIC_LIB GLOG_INCLUDE_DIR) diff --git a/hbase-native-client/cmake/FindKrb5.cmake b/hbase-native-client/cmake/FindKrb5.cmake new file mode 100644 index 000000000000..e4c6fb835715 --- /dev/null +++ b/hbase-native-client/cmake/FindKrb5.cmake @@ -0,0 +1,43 @@ +# 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. +# +find_path(KRB5_ROOT_DIR + NAMES include/krb5/krb5.h +) +find_library(KRB5_LIBRARIES + NAMES krb5 + HINTS ${KRB5_ROOT_DIR}/lib +) +find_path(KRB5_INCLUDE_DIR + NAMES krb5/krb5.h + HINTS ${KRB5_ROOT_DIR}/include +) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(krb5 DEFAULT_MSG + KRB5_LIBRARIES + KRB5_INCLUDE_DIR +) +if (KRB5_LIBRARIES) + set(KRB5_FOUND "true") + message("-- KRB5 Libs Found, ${KRB5_LIBRARIES}") +endif() +mark_as_advanced( + KRB5_ROOT_DIR + KRB5_LIBRARIES + KRB5_INCLUDE_DIR +) diff --git a/hbase-native-client/cmake/FindSasl2.cmake b/hbase-native-client/cmake/FindSasl2.cmake new file mode 100644 index 000000000000..871385bb3a4e --- /dev/null +++ b/hbase-native-client/cmake/FindSasl2.cmake @@ -0,0 +1,29 @@ +# 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(CheckSymbolExists) +find_path ( + SASL_INCLUDE_DIRS NAMES sasl/sasl.h + PATHS /include /usr/include /usr/local/include /usr/share/include) +find_library( + SASL_LIBS NAMES sasl2 + PATHS /usr/lib /lib /usr/local/lib /usr/lib/x86_64-linux-gnu/) +if (SASL_INCLUDE_DIRS AND SASL_LIBS) + set (SASL_FOUND 1) + message("-- LibSASL found, ${SASL_LIBS}") +endif () diff --git a/hbase-native-client/cmake/FindWangle.cmake b/hbase-native-client/cmake/FindWangle.cmake new file mode 100644 index 000000000000..6e69faa36f4c --- /dev/null +++ b/hbase-native-client/cmake/FindWangle.cmake @@ -0,0 +1,43 @@ +# 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. +# +find_path(WANGLE_ROOT_DIR + NAMES include/wangle/acceptor/Acceptor.h +) +find_library(WANGLE_LIBRARIES + NAMES wangle + HINTS ${WANGLE_ROOT_DIR}/lib /usr/lib/ /usr/local/lib/ +) +find_path(WANGLE_INCLUDE_DIR + NAMES wangle/acceptor/Acceptor.h + HINTS ${WANGLE_ROOT_DIR}/include /usr/local/include/ +) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WANGLE DEFAULT_MSG + WANGLE_LIBRARIES + WANGLE_INCLUDE_DIR +) +mark_as_advanced( + WANGLE_ROOT_DIR + WANGLE_LIBRARIES + WANGLE_INCLUDE_DIR +) +if (WANGLE_LIBRARIES) + set(WANGLE_FOUND "true") + message("-- Wangle found, ${WANGLE_LIBRARIES}") +endif(WANGLE_LIBRARIES) diff --git a/hbase-native-client/cmake/FindZookeeper.cmake b/hbase-native-client/cmake/FindZookeeper.cmake new file mode 100644 index 000000000000..a9e9d3d1c8fb --- /dev/null +++ b/hbase-native-client/cmake/FindZookeeper.cmake @@ -0,0 +1,51 @@ +# 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. +# +if (MSVC) + if(${CMAKE_BUILD_TYPE} MATCHES "Debug") + set(ZK_BuildOutputDir "Debug") + else() + set(ZK_BuildOutputDir "Release") + endif() + if("${ZOOKEEPER_HOME}_" MATCHES "^_$") + message(" ") + message("- Please set the cache variable ZOOKEEPER_HOME to point to the directory with the zookeeper source.") + message("- CMAKE will look for zookeeper include files in $ZOOKEEPER_HOME/src/c/include.") + message("- CMAKE will look for zookeeper library files in $ZOOKEEPER_HOME/src/c/Debug or $ZOOKEEPER_HOME/src/c/Release.") + else() + FILE(TO_CMAKE_PATH ${ZOOKEEPER_HOME} Zookeeper_HomePath) + set(Zookeeper_LIB_PATHS ${Zookeeper_HomePath}/src/c/${ZK_BuildOutputDir}) + find_path(ZK_INCLUDE_DIR zookeeper.h ${Zookeeper_HomePath}/src/c/include) + find_path(ZK_INCLUDE_DIR_GEN zookeeper.jute.h ${Zookeeper_HomePath}/src/c/generated) + set(Zookeeper_INCLUDE_DIR zookeeper.h ${ZK_INCLUDE_DIR} ${ZK_INCLUDE_DIR_GEN} ) + find_library(Zookeeper_LIBRARY NAMES zookeeper PATHS ${Zookeeper_LIB_PATHS}) + endif() +else() + set(Zookeeper_LIB_PATHS /usr/local/lib /usr/lib/ /usr/lib/x86_64-linux-gnu/) + find_path(Zookeeper_INCLUDE_DIR zookeeper/zookeeper.h /usr/local/include) + find_library(Zookeeper_LIBRARY NAMES libzookeeper_mt.a PATHS ${Zookeeper_LIB_PATHS}) +endif() +set(Zookeeper_LIBRARIES ${Zookeeper_LIBRARY} ) +set(Zookeeper_INCLUDE_DIRS ${Zookeeper_INCLUDE_DIR} ) +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set Zookeeper_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(Zookeeper DEFAULT_MSG + Zookeeper_LIBRARY Zookeeper_INCLUDE_DIR) +if (Zookeeper_LIBRARY) + message("-- Zookeeper found, ${Zookeeper_LIBRARY}") +endif() +mark_as_advanced(Zookeeper_INCLUDE_DIR Zookeeper_LIBRARY ) diff --git a/hbase-native-client/cmake/ProtobufGen.cmake b/hbase-native-client/cmake/ProtobufGen.cmake new file mode 100644 index 000000000000..f34bba4cba21 --- /dev/null +++ b/hbase-native-client/cmake/ProtobufGen.cmake @@ -0,0 +1,62 @@ +# 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. +# copied in most part from protobuf cmake +# there are similar protobuf gen changes online, all of which do +# a similar job of customizing their generation. +function(generate_protobuf_src SRCS HDRS) + if(NOT ARGN) + message(SEND_ERROR "Error: generate_protobuf_src() called without any proto files") + return() + endif() + + set(_protobuf_include_path -I .) + if(DEFINED PROTOBUF_INCLUDE_DIRS) + foreach(DIR ${PROTOBUF_INCLUDE_DIRS}) + file(RELATIVE_PATH REL_PATH ${CMAKE_SOURCE_DIR} ${DIR}) + list(FIND _protobuf_include_path ${REL_PATH} _contains_already) + if(${_contains_already} EQUAL -1) + list(APPEND _protobuf_include_path -I ${REL_PATH}) + endif() + endforeach() + endif() + set(${SRCS}) + set(${HDRS}) + foreach(FIL ${ARGN}) + get_filename_component(ABS_FIL ${FIL} ABSOLUTE) + get_filename_component(FIL_WE ${FIL} NAME_WE) + ## get the directory where our protobufs are stored + file(RELATIVE_PATH REL_FIL ${CMAKE_SOURCE_DIR} ${ABS_FIL}) + get_filename_component(REL_DIR ${REL_FIL} DIRECTORY) + list(APPEND ${SRCS} "${CMAKE_BINARY_DIR_GEN}/${FIL_WE}.pb.cc") + list(APPEND ${HDRS} "${CMAKE_BINARY_DIR_GEN}/${FIL_WE}.pb.h") + add_custom_command( + OUTPUT "${CMAKE_BINARY_DIR_GEN}/${FIL_WE}.pb.cc" + "${CMAKE_BINARY_DIR_GEN}/${FIL_WE}.pb.h" + COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} + ARGS --cpp_out=${CMAKE_BINARY_DIR_GEN} + --proto_path=${REL_DIR} + ${_protobuf_include_path} + ${REL_FIL} + DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMENT "Generating ${FIL}" + VERBATIM) + endforeach() + set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE) + set(${SRCS} ${${SRCS}} PARENT_SCOPE) + set(${HDRS} ${${HDRS}} PARENT_SCOPE) +endfunction() diff --git a/hbase-native-client/src/hbase/test-util/mini-cluster.h b/hbase-native-client/include/hbase/test-util/mini-cluster.h similarity index 98% rename from hbase-native-client/src/hbase/test-util/mini-cluster.h rename to hbase-native-client/include/hbase/test-util/mini-cluster.h index 6b4547cd691f..978ded8c6941 100644 --- a/hbase-native-client/src/hbase/test-util/mini-cluster.h +++ b/hbase-native-client/include/hbase/test-util/mini-cluster.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace hbase { @@ -69,7 +70,7 @@ class MiniCluster { jmethodID str_ctor_mid_; jobject htu_; jobject cluster_; - pthread_mutex_t count_mutex_; + std::mutex count_mutex_; JavaVM *jvm_; JNIEnv *CreateVM(JavaVM **jvm); void Setup(); diff --git a/hbase-native-client/src/hbase/test-util/test-util.h b/hbase-native-client/include/hbase/test-util/test-util.h similarity index 100% rename from hbase-native-client/src/hbase/test-util/test-util.h rename to hbase-native-client/include/hbase/test-util/test-util.h diff --git a/hbase-native-client/src/hbase/client/load-client.cc b/hbase-native-client/src/hbase/examples/load-client.cc similarity index 100% rename from hbase-native-client/src/hbase/client/load-client.cc rename to hbase-native-client/src/hbase/examples/load-client.cc diff --git a/hbase-native-client/src/hbase/client/simple-client.cc b/hbase-native-client/src/hbase/examples/simple-client.cc similarity index 100% rename from hbase-native-client/src/hbase/client/simple-client.cc rename to hbase-native-client/src/hbase/examples/simple-client.cc diff --git a/hbase-native-client/src/hbase/test-util/mini-cluster.cc b/hbase-native-client/src/hbase/test-util/mini-cluster.cc index 1e491a24f080..8e819edb6b9f 100644 --- a/hbase-native-client/src/hbase/test-util/mini-cluster.cc +++ b/hbase-native-client/src/hbase/test-util/mini-cluster.cc @@ -80,7 +80,7 @@ MiniCluster::~MiniCluster() { void MiniCluster::Setup() { jmethodID constructor; - pthread_mutex_lock(&count_mutex_); + std::lock_guard lock(count_mutex_); if (env_ == NULL) { env_ = CreateVM(&jvm_); if (env_ == NULL) { @@ -176,7 +176,6 @@ void MiniCluster::Setup() { exit(-1); } } - pthread_mutex_unlock(&count_mutex_); } jobject MiniCluster::htu() { diff --git a/hbase-native-client/src/hbase/utils/bytes-util.cc b/hbase-native-client/src/hbase/utils/bytes-util.cc index 144b866801b0..9c3155fc45cc 100644 --- a/hbase-native-client/src/hbase/utils/bytes-util.cc +++ b/hbase-native-client/src/hbase/utils/bytes-util.cc @@ -19,7 +19,7 @@ #include "hbase/utils/bytes-util.h" -#include +//#include #include #include diff --git a/hbase-native-client/src/hbase/client/append-test.cc b/hbase-native-client/src/test/append-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/append-test.cc rename to hbase-native-client/src/test/append-test.cc diff --git a/hbase-native-client/src/hbase/client/async-batch-rpc-retrying-test.cc b/hbase-native-client/src/test/async-batch-rpc-retrying-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/async-batch-rpc-retrying-test.cc rename to hbase-native-client/src/test/async-batch-rpc-retrying-test.cc diff --git a/hbase-native-client/src/hbase/client/async-rpc-retrying-test.cc b/hbase-native-client/src/test/async-rpc-retrying-test.cc similarity index 99% rename from hbase-native-client/src/hbase/client/async-rpc-retrying-test.cc rename to hbase-native-client/src/test/async-rpc-retrying-test.cc index 6782d05cf995..b590b43fd316 100644 --- a/hbase-native-client/src/hbase/client/async-rpc-retrying-test.cc +++ b/hbase-native-client/src/test/async-rpc-retrying-test.cc @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/hbase-native-client/src/hbase/utils/bytes-util-test.cc b/hbase-native-client/src/test/bytes-util-test.cc similarity index 100% rename from hbase-native-client/src/hbase/utils/bytes-util-test.cc rename to hbase-native-client/src/test/bytes-util-test.cc diff --git a/hbase-native-client/src/hbase/client/cell-test.cc b/hbase-native-client/src/test/cell-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/cell-test.cc rename to hbase-native-client/src/test/cell-test.cc diff --git a/hbase-native-client/src/hbase/serde/client-deserializer-test.cc b/hbase-native-client/src/test/client-deserializer-test.cc similarity index 100% rename from hbase-native-client/src/hbase/serde/client-deserializer-test.cc rename to hbase-native-client/src/test/client-deserializer-test.cc diff --git a/hbase-native-client/src/hbase/serde/client-serializer-test.cc b/hbase-native-client/src/test/client-serializer-test.cc similarity index 100% rename from hbase-native-client/src/hbase/serde/client-serializer-test.cc rename to hbase-native-client/src/test/client-serializer-test.cc diff --git a/hbase-native-client/src/hbase/client/client-test.cc b/hbase-native-client/src/test/client-test.cc similarity index 99% rename from hbase-native-client/src/hbase/client/client-test.cc rename to hbase-native-client/src/test/client-test.cc index 0773d3dea034..b1d5180e97c6 100644 --- a/hbase-native-client/src/hbase/client/client-test.cc +++ b/hbase-native-client/src/test/client-test.cc @@ -19,6 +19,7 @@ #include +#include #include "hbase/client/append.h" #include "hbase/client/cell.h" #include "hbase/client/client.h" diff --git a/hbase-native-client/src/hbase/utils/concurrent-map-test.cc b/hbase-native-client/src/test/concurrent-map-test.cc similarity index 100% rename from hbase-native-client/src/hbase/utils/concurrent-map-test.cc rename to hbase-native-client/src/test/concurrent-map-test.cc diff --git a/hbase-native-client/src/hbase/client/configuration-test.cc b/hbase-native-client/src/test/configuration-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/configuration-test.cc rename to hbase-native-client/src/test/configuration-test.cc diff --git a/hbase-native-client/src/hbase/connection/connection-pool-test.cc b/hbase-native-client/src/test/connection-pool-test.cc similarity index 100% rename from hbase-native-client/src/hbase/connection/connection-pool-test.cc rename to hbase-native-client/src/test/connection-pool-test.cc diff --git a/hbase-native-client/src/hbase/client/delete-test.cc b/hbase-native-client/src/test/delete-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/delete-test.cc rename to hbase-native-client/src/test/delete-test.cc diff --git a/hbase-native-client/src/hbase/exceptions/exception-test.cc b/hbase-native-client/src/test/exception-test.cc similarity index 100% rename from hbase-native-client/src/hbase/exceptions/exception-test.cc rename to hbase-native-client/src/test/exception-test.cc diff --git a/hbase-native-client/src/hbase/client/filter-test.cc b/hbase-native-client/src/test/filter-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/filter-test.cc rename to hbase-native-client/src/test/filter-test.cc diff --git a/hbase-native-client/src/hbase/client/get-test.cc b/hbase-native-client/src/test/get-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/get-test.cc rename to hbase-native-client/src/test/get-test.cc diff --git a/hbase-native-client/src/hbase/client/hbase-configuration-test.cc b/hbase-native-client/src/test/hbase-configuration-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/hbase-configuration-test.cc rename to hbase-native-client/src/test/hbase-configuration-test.cc diff --git a/hbase-native-client/src/hbase/client/increment-test.cc b/hbase-native-client/src/test/increment-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/increment-test.cc rename to hbase-native-client/src/test/increment-test.cc diff --git a/hbase-native-client/src/hbase/client/location-cache-retry-test.cc b/hbase-native-client/src/test/location-cache-retry-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/location-cache-retry-test.cc rename to hbase-native-client/src/test/location-cache-retry-test.cc diff --git a/hbase-native-client/src/hbase/client/location-cache-test.cc b/hbase-native-client/src/test/location-cache-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/location-cache-test.cc rename to hbase-native-client/src/test/location-cache-test.cc diff --git a/hbase-native-client/src/hbase/client/put-test.cc b/hbase-native-client/src/test/put-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/put-test.cc rename to hbase-native-client/src/test/put-test.cc diff --git a/hbase-native-client/src/hbase/serde/region-info-deserializer-test.cc b/hbase-native-client/src/test/region-info-deserializer-test.cc similarity index 100% rename from hbase-native-client/src/hbase/serde/region-info-deserializer-test.cc rename to hbase-native-client/src/test/region-info-deserializer-test.cc diff --git a/hbase-native-client/src/hbase/client/request-converter-test.cc b/hbase-native-client/src/test/request-converter-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/request-converter-test.cc rename to hbase-native-client/src/test/request-converter-test.cc diff --git a/hbase-native-client/src/hbase/client/result-test.cc b/hbase-native-client/src/test/result-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/result-test.cc rename to hbase-native-client/src/test/result-test.cc diff --git a/hbase-native-client/src/hbase/connection/rpc-test.cc b/hbase-native-client/src/test/rpc-test.cc similarity index 100% rename from hbase-native-client/src/hbase/connection/rpc-test.cc rename to hbase-native-client/src/test/rpc-test.cc diff --git a/hbase-native-client/src/hbase/client/scan-result-cache-test.cc b/hbase-native-client/src/test/scan-result-cache-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/scan-result-cache-test.cc rename to hbase-native-client/src/test/scan-result-cache-test.cc diff --git a/hbase-native-client/src/hbase/client/scan-test.cc b/hbase-native-client/src/test/scan-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/scan-test.cc rename to hbase-native-client/src/test/scan-test.cc diff --git a/hbase-native-client/src/hbase/client/scanner-test.cc b/hbase-native-client/src/test/scanner-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/scanner-test.cc rename to hbase-native-client/src/test/scanner-test.cc diff --git a/hbase-native-client/src/hbase/serde/server-name-test.cc b/hbase-native-client/src/test/server-name-test.cc similarity index 100% rename from hbase-native-client/src/hbase/serde/server-name-test.cc rename to hbase-native-client/src/test/server-name-test.cc diff --git a/hbase-native-client/src/hbase/serde/table-name-test.cc b/hbase-native-client/src/test/table-name-test.cc similarity index 100% rename from hbase-native-client/src/hbase/serde/table-name-test.cc rename to hbase-native-client/src/test/table-name-test.cc diff --git a/hbase-native-client/src/hbase/client/time-range-test.cc b/hbase-native-client/src/test/time-range-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/time-range-test.cc rename to hbase-native-client/src/test/time-range-test.cc diff --git a/hbase-native-client/src/hbase/utils/user-util-test.cc b/hbase-native-client/src/test/user-util-test.cc similarity index 100% rename from hbase-native-client/src/hbase/utils/user-util-test.cc rename to hbase-native-client/src/test/user-util-test.cc diff --git a/hbase-native-client/src/hbase/serde/zk-deserializer-test.cc b/hbase-native-client/src/test/zk-deserializer-test.cc similarity index 100% rename from hbase-native-client/src/hbase/serde/zk-deserializer-test.cc rename to hbase-native-client/src/test/zk-deserializer-test.cc diff --git a/hbase-native-client/src/hbase/client/zk-util-test.cc b/hbase-native-client/src/test/zk-util-test.cc similarity index 100% rename from hbase-native-client/src/hbase/client/zk-util-test.cc rename to hbase-native-client/src/test/zk-util-test.cc