Skip to content

Commit

Permalink
2.2 work with v7.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Change72 committed Jan 3, 2024
1 parent 408bc4a commit 6cc1df4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "C
endif()
endif()

message(STATUS "Found zlib in ${zlib_SOURCE_DIR}")

add_library(zlib_with_headers INTERFACE) # rocksdb use it
target_include_directories(zlib_with_headers INTERFACE $<BUILD_INTERFACE:${zlib_SOURCE_DIR}> $<BUILD_INTERFACE:${zlib_BINARY_DIR}>)
target_link_libraries(zlib_with_headers INTERFACE zlibstatic)
add_library(ZLIB::ZLIB ALIAS zlib_with_headers)
install(TARGETS zlibstatic zlib_with_headers EXPORT RocksDBTargets) # export for install(...)

# kvrocks objects target
file(GLOB_RECURSE KVROCKS_SRCS src/*.cc)
list(FILTER KVROCKS_SRCS EXCLUDE REGEX src/main.cc)
Expand Down
4 changes: 2 additions & 2 deletions cmake/rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ endif()
include(cmake/utils.cmake)

FetchContent_DeclareGitHubWithMirrorR(rocksdb
asu-idi/rocksdb_get_block_private.git
origin/cache_filter
Change72/remote_flush.git
origin/v7.7.3-hdfs-kvrocks
)

FetchContent_GetProperties(jemalloc)
Expand Down
2 changes: 1 addition & 1 deletion src/stats/disk_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Redis {
class Disk : public Database {
public:
explicit Disk(Engine::Storage *storage, const std::string &ns) : Database(storage, ns) {
option_.include_memtabtles = true;
option_.include_memtables = true;
option_.include_files = true;
}
rocksdb::Status GetApproximateSizes(const Metadata &metadata, const Slice &ns_key,
Expand Down
2 changes: 1 addition & 1 deletion src/storage/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ uint64_t Storage::GetTotalSize(const std::string &ns) {
Redis::Database db(this, ns);
uint64_t size, total_size = 0;
uint8_t include_both =
rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES | rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES;
static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES | rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES);
for (auto cf_handle : cf_handles_) {
if (cf_handle == GetCFHandle(kPubSubColumnFamilyName) || cf_handle == GetCFHandle(kPropagateColumnFamilyName)) {
continue;
Expand Down

0 comments on commit 6cc1df4

Please sign in to comment.