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
…20927)

Import starcache submodule as a new block cache engine which support KV interfaces, and provides memory and disk cache. Currently, we support both cachelib and starcache engines, and we set the starcache as the default engine.

Signed-off-by: GavinMar <yangguansuo@starrocks.com>
  • Loading branch information
GavinMar authored Apr 11, 2023
1 parent c4cb3ac commit f2fbbf2
Show file tree
Hide file tree
Showing 22 changed files with 706 additions and 99 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/thirdparty/starcache"]
path = be/src/thirdparty/starcache
url = https://github.com/StarRocks/starcache.git
22 changes: 9 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 @@ -361,7 +361,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 +463,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 @@ -620,13 +620,11 @@ set(STARROCKS_LINK_LIBS
TestUtil
Tools
Geo
BlockCache
starcache
${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 @@ -707,7 +705,7 @@ set(STARROCKS_DEPENDENCIES
${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 @@ -859,6 +857,8 @@ 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}/thirdparty/starcache)

add_subdirectory(${SRC_DIR}/tools)
add_subdirectory(${SRC_DIR}/util)
Expand All @@ -869,10 +869,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 f2fbbf2

Please sign in to comment.