Skip to content

Commit

Permalink
[Enhancement] Import starcache submodule to support DLA block cache. (#…
Browse files Browse the repository at this point in the history
…20164)

Signed-off-by: GavinMar <yangguansuo@starrocks.com>
  • Loading branch information
GavinMar authored Mar 28, 2023
1 parent 4115e3e commit ed55db7
Show file tree
Hide file tree
Showing 20 changed files with 705 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "be/src/submodules/starcache"]
path = be/src/submodules/starcache
url = https://github.com/StarRocks/starcache.git
25 changes: 12 additions & 13 deletions be/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ option(WITH_GCOV "Build binary with gcov to get code coverage" OFF)

option(WITH_COMPRESS "Build binary with compresss debug section" ON)

option(WITH_BLOCK_CACHE "Build binary with block cache feature" OFF)
option(WITH_CACHELIB "Build binary with cachelib library" OFF)

option(WITH_BENCH "Build binary with bench" OFF)

Expand Down Expand Up @@ -336,6 +336,10 @@ set_target_properties(serdes PROPERTIES IMPORTED_LOCATION ${THIRDPARTY_DIR}/lib/
add_library(opentelemetry_exporter_jaeger_trace STATIC IMPORTED GLOBAL)
set_target_properties(opentelemetry_exporter_jaeger_trace PROPERTIES IMPORTED_LOCATION ${THIRDPARTY_DIR}/lib64/libopentelemetry_exporter_jaeger_trace.a)

add_library(starcache STATIC IMPORTED)
set_target_properties(starcache PROPERTIES IMPORTED_LOCATION ${starcache_DIR}/lib64/libstarcache.a)
include_directories(${starcache_DIR}/include)

# cachelib
set(CACHELIB_DEPENDENCIES
cachelib_common
Expand All @@ -361,7 +365,7 @@ set(CACHELIB_DEPENDENCIES
wangle
)

if (${WITH_BLOCK_CACHE} STREQUAL "ON")
if (${WITH_CACHELIB} STREQUAL "ON")
LINK_LIBRARIES(${THIRDPARTY_DIR}/cachelib/deps/lib64/libunwind.so)
LINK_LIBRARIES(${THIRDPARTY_DIR}/cachelib/deps/lib64/liblzma.so)
foreach(dep ${CACHELIB_DEPENDENCIES})
Expand Down Expand Up @@ -463,8 +467,8 @@ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror=return-type -Werror=switch")
if (${USE_STAROS} STREQUAL "ON")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -DUSE_STAROS")
endif()
if (${WITH_BLOCK_CACHE} STREQUAL "ON")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -DWITH_BLOCK_CACHE")
if (${WITH_CACHELIB} STREQUAL "ON")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -DWITH_CACHELIB")
endif()

# When LLVM is used, should give GCC_HOME to get c++11 header to use new string and list
Expand Down Expand Up @@ -619,13 +623,10 @@ set(STARROCKS_LINK_LIBS
TestUtil
Tools
Geo
BlockCache
${WL_END_GROUP}
)

if (${WITH_BLOCK_CACHE} STREQUAL "ON")
set(STARROCKS_LINK_LIBS ${STARROCKS_LINK_LIBS} BlockCache)
endif()

set(STARROCKS_DEPENDENCIES ${STARROCKS_DEPENDENCIES}
mysql
)
Expand Down Expand Up @@ -703,10 +704,11 @@ set(STARROCKS_DEPENDENCIES
jansson
avro
serdes
starcache
${WL_END_GROUP}
)

if (${WITH_BLOCK_CACHE} STREQUAL "ON")
if (${WITH_CACHELIB} STREQUAL "ON")
set(STARROCKS_DEPENDENCIES
${STARROCKS_DEPENDENCIES}
${WL_START_GROUP}
Expand Down Expand Up @@ -858,6 +860,7 @@ add_subdirectory(${SRC_DIR}/service)
add_subdirectory(${SRC_DIR}/testutil)
add_subdirectory(${SRC_DIR}/types)
add_subdirectory(${SRC_DIR}/udf)
add_subdirectory(${SRC_DIR}/block_cache)

add_subdirectory(${SRC_DIR}/tools)
add_subdirectory(${SRC_DIR}/util)
Expand All @@ -867,10 +870,6 @@ if (WITH_BENCH STREQUAL "ON")
add_subdirectory(${SRC_DIR}/bench)
endif()

if (${WITH_BLOCK_CACHE} STREQUAL "ON")
add_subdirectory(${SRC_DIR}/block_cache)
endif()

if (${MAKE_TEST} STREQUAL "ON")
add_subdirectory(test)
endif ()
Expand Down
1 change: 1 addition & 0 deletions be/src/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ ADD_BE_BENCH(${SRC_DIR}/bench/chunks_sorter_bench)
ADD_BE_BENCH(${SRC_DIR}/bench/runtime_filter_bench)
ADD_BE_BENCH(${SRC_DIR}/bench/csv_reader_bench)
ADD_BE_BENCH(${SRC_DIR}/bench/shuffle_chunk_bench)
ADD_BE_BENCH(${SRC_DIR}/bench/block_cache_bench)
Loading

0 comments on commit ed55db7

Please sign in to comment.