This is an automated email from the ASF dual-hosted git repository.
twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 08c73350 The storage engine type awareness in Kvrocks (#1973)
08c73350 is described below
commit 08c73350d914dde2fa83f2f7fcdfb83a839f1247
Author: HashTagInclude <[email protected]>
AuthorDate: Wed Jan 3 08:22:29 2024 +0530
The storage engine type awareness in Kvrocks (#1973)
Co-authored-by: hulk <[email protected]>
Co-authored-by: Twice <[email protected]>
---
CMakeLists.txt | 5 +++++
src/storage/storage.h | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f76d30e6..ea4d1bec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,6 +216,11 @@ elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
(CMAKE_CXX_COMPILER_ID STREQU
endif()
target_link_libraries(kvrocks_objs PUBLIC -fno-omit-frame-pointer)
target_link_libraries(kvrocks_objs PUBLIC ${EXTERNAL_LIBS})
+if (ENABLE_SPEEDB)
+ target_compile_definitions(kvrocks_objs PUBLIC
KVROCKS_STORAGE_ENGINE=Speedb)
+else()
+ target_compile_definitions(kvrocks_objs PUBLIC
KVROCKS_STORAGE_ENGINE=RocksDB)
+endif()
if(ENABLE_OPENSSL)
target_compile_definitions(kvrocks_objs PUBLIC ENABLE_OPENSSL)
endif()
diff --git a/src/storage/storage.h b/src/storage/storage.h
index 570ecf6c..96479ec9 100644
--- a/src/storage/storage.h
+++ b/src/storage/storage.h
@@ -41,6 +41,13 @@
#include "observer_or_unique.h"
#include "status.h"
+enum class StorageEngineType : uint16_t {
+ RocksDB,
+ Speedb,
+};
+
+inline constexpr StorageEngineType STORAGE_ENGINE_TYPE =
StorageEngineType::KVROCKS_STORAGE_ENGINE;
+
const int kReplIdLength = 16;
enum ColumnFamilyID {