Skip to content

Commit

Permalink
Refactored dataman (vesoft-inc#2)
Browse files Browse the repository at this point in the history
* Refactored the dataman

1) Rename dataman to codec
2) Make the new codec compatible with V1 data (be able to read)
3) Connected with nebula-common
  • Loading branch information
sherman-the-tank authored Mar 11, 2020
1 parent 8186ff9 commit 4485b58
Show file tree
Hide file tree
Showing 57 changed files with 1,886 additions and 2,162 deletions.
34 changes: 29 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ endif()
if("${NEBULA_COMMON_REPO_URL}" STREQUAL "")
SET(NEBULA_COMMON_REPO_URL "[email protected]:vesoft-inc-private/nebula-common.git")
endif()
message(STATUS "NEBULA_COMMON_REPO_URL: " ${NEBULA_COMMON_REPO_URL})

if("${NEBULA_COMMON_REPO_TAG}" STREQUAL "")
SET(NEBULA_COMMON_REPO_TAG "HEAD")
endif()
message(STATUS "NEBULA_COMMON_REPO_TAG: " ${NEBULA_COMMON_REPO_TAG})

SET(NEBULA_COMMON_PACKAGE "nebula-common")

Expand All @@ -154,6 +156,7 @@ add_dependent_project(
find_package(${NEBULA_COMMON_PACKAGE} REQUIRED)
message(STATUS ">>>>> The nebula-common repo has been configured successfully <<<<<")
message(STATUS "")
include_directories(AFTER modules/common/src)

# third-party
if(NOT ${NEBULA_THIRDPARTY_ROOT} STREQUAL "")
Expand Down Expand Up @@ -189,7 +192,30 @@ message(STATUS "CMAKE_INCLUDE_PATH: " ${INCLUDE_PATH_STR})
message(STATUS "CMAKE_LIBRARY_PATH: " ${LIBRARY_PATH_STR})
message(STATUS "CMAKE_PROGRAM_PATH: " ${PROGRAM_PATH_STR})

find_package(Bzip2 REQUIRED)
find_package(DoubleConversion REQUIRED)
find_package(Fbthrift REQUIRED)
find_package(Folly REQUIRED)
find_package(Gflags REQUIRED)
find_package(Glog REQUIRED)
find_package(Googletest REQUIRED)
find_package(Jemalloc REQUIRED)
find_package(Libevent REQUIRED)
find_package(Mstch REQUIRED)
find_package(Proxygen REQUIRED)
find_package(Snappy REQUIRED)
find_package(Wangle REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Zstd REQUIRED)
find_package(Boost REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Krb5 REQUIRED gssapi)
find_package(GPERF 2.8 REQUIRED)
find_package(Libunwind REQUIRED)
find_package(LibLZMA MODULE)

find_package(Rocksdb REQUIRED)
find_package(nebula-common REQUIRED)

add_compile_options(-Wall)
add_compile_options(-Werror)
Expand Down Expand Up @@ -316,8 +342,6 @@ macro(nebula_add_library name type)
endmacro()

include_directories(AFTER ${NEBULA_HOME}/src)
include_directories(AFTER modules/common/src)
include_directories(AFTER modules/common/src/interface)
include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/src)
include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/src/kvstore/plugins)
include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/src/kvstore/plugins/hbase)
Expand Down Expand Up @@ -385,11 +409,11 @@ macro(nebula_link_libraries target)
double-conversion
resolv
s2
${COMPRESSION_LIBRARIES}
${JEMALLOC_LIB}
${OPENSSL_SSL_LIBRARY}
${OPENSSL_CRYPTO_LIBRARY}
${KRB5_LIBRARIES}
${COMPRESSION_LIBRARIES}
${JEMALLOC_LIB}
${LIBUNWIND_LIBRARIES}
dl
${GETTIME_LIB}
Expand All @@ -404,7 +428,7 @@ function(nebula_add_subdirectory dir_name)
add_subdirectory(${dir_name})
endfunction()

#add_subdirectory(src)
add_subdirectory(src)
add_subdirectory(conf)
add_subdirectory(scripts)

Expand Down
34 changes: 34 additions & 0 deletions cmake/FindBzip2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# - Try to find Bzip2 includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Bzip2)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Bzip2_FOUND System has bzip2, include and lib dirs found.
# Bzip2_INCLUDE_DIR The bzip2 includes directories.
# Bzip2_LIBRARY The bzip2 library.
# Bzip2_BIN The bzip2 binary.

find_path(Bzip2_INCLUDE_DIR NAMES bzlib.h)
find_library(Bzip2_LIBRARY NAMES libbz2.a)
find_program(Bzip2_BIN NAMES bzip2)

if(Bzip2_INCLUDE_DIR AND Bzip2_LIBRARY AND Bzip2_BIN)
set(Bzip2_FOUND TRUE)
mark_as_advanced(
Bzip2_INCLUDE_DIR
Bzip2_LIBRARY
Bzip2_BIN
)
endif()

if(NOT Bzip2_FOUND)
message(FATAL_ERROR "Bzip2 doesn't exist")
endif()


30 changes: 30 additions & 0 deletions cmake/FindDoubleConversion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# - Try to find libdouble-conversion includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(DoubleConversion)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# DoubleConversion_FOUND System has double-conversion, include and lib dirs found
# DoubleConversion_INCLUDE_DIR The double-conversion includes directories.
# DoubleConversion_LIBRARY The double-conversion library.

find_path(DoubleConversion_INCLUDE_DIR NAMES double-conversion.h)
find_library(DoubleConversion_LIBRARY NAMES libdouble-conversion.a)

if(DoubleConversion_INCLUDE_DIR AND DoubleConversion_LIBRARY)
set(DoubleConversion_FOUND TRUE)
mark_as_advanced(
DoubleConversion_INCLUDE_DIR
DoubleConversion_LIBRARY
)
endif()

if(NOT DoubleConversion_FOUND)
message(FATAL_ERROR "Double-conversion doesn't exist")
endif()

33 changes: 33 additions & 0 deletions cmake/FindFbthrift.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# - Try to find Fbthrift includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Fbthrift)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Fbthrift_FOUND System has fbthrift, thrift1 and include and lib dirs found.
# Fbthrift_INCLUDE_DIR The fbthrift includes directories.
# Fbthrift_LIBRARY The fbthrift library.
# Fbthrift_BIN The fbthrift binary.

find_path(Fbthrift_INCLUDE_DIR NAMES thrift)
find_library(Fbthrift_LIBRARY NAMES libthrift.a)
find_program(Fbthrift_BIN NAMES thrift1)

if(Fbthrift_INCLUDE_DIR AND Fbthrift_LIBRARY AND Fbthrift_BIN)
set(Fbthrift_FOUND TRUE)
mark_as_advanced(
Fbthrift_INCLUDE_DIR
Fbthrift_LIBRARY
Fbthrift_BIN
)
endif()

if(NOT Fbthrift_FOUND)
message(FATAL_ERROR "Fbthrift doesn't exist")
endif()

30 changes: 30 additions & 0 deletions cmake/FindFolly.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# - Try to find Folly includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Folly)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Folly_FOUND System has folly, include and lib dirs found
# Folly_INCLUDE_DIR The folly includes directories.
# Folly_LIBRARY The folly library.

find_path(Folly_INCLUDE_DIR NAMES folly)
find_library(Folly_LIBRARY NAMES libfolly.a libfollybenchmark.a)

if(Folly_INCLUDE_DIR AND Folly_LIBRARY)
set(Folly_FOUND TRUE)
mark_as_advanced(
Folly_INCLUDE_DIR
Folly_LIBRARY
)
endif()

if(NOT Folly_FOUND)
message(FATAL_ERROR "Folly doesn't exist")
endif()

61 changes: 61 additions & 0 deletions cmake/FindGPERF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# FindGPERF
# ---------
#
# Find ``gperf`` executable
#
# The module defines the following variables:
#
# ``GPERF_EXECUTABLE_DIR``
# path to search the gperf binary
#
# ``GPERF_EXECUTABLE``
# path to the ``gperf`` program
#
# ``GPERF_BIN_DIR``
# path to the directory that holds ``gperf`` program
#
# ``GPERF_VERSION``
# version of ``gperf``
#
# ``GPERF_FOUND``
# true if the program was found
#
# The minimum required version of ``gperf`` can be specified using the
# standard CMake syntax, e.g. ``find_package(GPERF 3.0)``.

find_program(GPERF_EXECUTABLE
NAMES gperf
PATHS ${GPERF_EXECUTABLE_DIR}
DOC "path to the gperf executable")

if(GPERF_EXECUTABLE)
# Extract the path
STRING(REGEX REPLACE "/gperf$" "" GPERF_BIN_DIR ${GPERF_EXECUTABLE})

# the gperf commands should be executed with the C locale, otherwise
# the message (which is parsed) may be translated
set(_gperf_SAVED_LC_ALL "$ENV{LC_ALL}")
set(ENV{LC_ALL} C)

execute_process(COMMAND ${GPERF_EXECUTABLE} --version
OUTPUT_VARIABLE GPERF_version_output
ERROR_VARIABLE GPERF_version_error
RESULT_VARIABLE GPERF_version_result
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(ENV{LC_ALL} ${_gperf_SAVED_LC_ALL})

if(NOT ${GPERF_version_result} EQUAL 0)
message(SEND_ERROR "Command \"${GPERF_EXECUTABLE} --version\" failed with output:\n${GPERF_version_error}")
else()
if("${GPERF_version_output}" MATCHES "^GNU gperf ([^\n]+)")
set(GPERF_VERSION "${CMAKE_MATCH_1}")
endif()
endif()

endif()
mark_as_advanced(GPERF_EXECUTABLE GPERF_BIN_DIR)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPERF REQUIRED_VARS GPERF_EXECUTABLE
VERSION_VAR GPERF_VERSION)
30 changes: 30 additions & 0 deletions cmake/FindGflags.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# - Try to find Gflags includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Gflags)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Gflags_FOUND System has Gflags, include and lib dirs found
# Gflags_INCLUDE_DIR The Gflags includes directories.
# Gflags_LIBRARY The Gflags library.

find_path(Gflags_INCLUDE_DIR NAMES gflags)
find_library(Gflags_LIBRARY NAMES libgflags.a)

if(Gflags_INCLUDE_DIR AND Gflags_LIBRARY)
set(Gflags_FOUND TRUE)
mark_as_advanced(
Gflags_INCLUDE_DIR
Gflags_LIBRARY
)
endif()

if(NOT Gflags_FOUND)
message(FATAL_ERROR "Gflags doesn't exist")
endif()

30 changes: 30 additions & 0 deletions cmake/FindGlog.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# - Try to find Glog includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Glog)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Glog_FOUND System has Glog, include and lib dirs found
# Glog_INCLUDE_DIR The Glog includes directories.
# Glog_LIBRARY The Glog library.

find_path(Glog_INCLUDE_DIR NAMES glog)
find_library(Glog_LIBRARY NAMES libglog.a)

if(Glog_INCLUDE_DIR AND Glog_LIBRARY)
set(Glog_FOUND TRUE)
mark_as_advanced(
Glog_INCLUDE_DIR
Glog_LIBRARY
)
endif()

if(NOT Glog_FOUND)
message(FATAL_ERROR "Glog doesn't exist")
endif()

30 changes: 30 additions & 0 deletions cmake/FindGoogletest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# - Try to find Googletest includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Googletest)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Googletest_FOUND System has Googletest, include and lib dirs found
# Googletest_INCLUDE_DIR The Googletest includes directories.
# Googletest_LIBRARY The Googletest library.

find_path(Googletest_INCLUDE_DIR NAMES gmock gtest)
find_library(Googletest_LIBRARY NAMES libgmock.a libgmock_main.a libgtest.a libgtest_main.a)

if(Googletest_INCLUDE_DIR AND Googletest_LIBRARY)
set(Googletest_FOUND TRUE)
mark_as_advanced(
Googletest_INCLUDE_DIR
Googletest_LIBRARY
)
endif()

if(NOT Googletest_FOUND)
message(FATAL_ERROR "Googletest doesn't exist")
endif()

29 changes: 29 additions & 0 deletions cmake/FindJemalloc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# - Try to find Jemalloc includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Jemalloc)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Jemalloc_FOUND System has Jemalloc, include and lib dirs found
# Jemalloc_INCLUDE_DIR The Jemalloc includes directories.
# Jemalloc_LIBRARY The Jemalloc library.

find_path(Jemalloc_INCLUDE_DIR NAMES jemalloc)
find_library(Jemalloc_LIBRARY NAMES libjemalloc.a)

if(Jemalloc_INCLUDE_DIR AND Jemalloc_LIBRARY)
set(Jemalloc_FOUND TRUE)
mark_as_advanced(
Jemalloc_INCLUDE_DIR
Jemalloc_LIBRARY
)
endif()

if(NOT Jemalloc_FOUND)
message(FATAL_ERROR "Jemalloc doesn't exist")
endif()
Loading

0 comments on commit 4485b58

Please sign in to comment.