From 345ccb81d181d908fae08afc0a9f507d9bc53a80 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 22 Mar 2023 12:11:16 +0800 Subject: [PATCH] fix: build with rocksdb v8.0 --- build.sh | 2 +- c.h | 4 ---- options_block_based_table.go | 10 ++-------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/build.sh b/build.sh index 2116426..3459d68 100644 --- a/build.sh +++ b/build.sh @@ -37,7 +37,7 @@ cd $BUILD_PATH && wget https://github.com/facebook/zstd/archive/v${zstd_version} # Note: if you don't have a good reason, please do not set -DPORTABLE=ON # # This one is set here on purpose of compatibility with github action runtime processor -rocksdb_version="7.10.2" +rocksdb_version="8.0.0" cd $BUILD_PATH && wget https://github.com/facebook/rocksdb/archive/v${rocksdb_version}.tar.gz && tar xzf v${rocksdb_version}.tar.gz && cd rocksdb-${rocksdb_version}/ && \ mkdir -p build_place && cd build_place && cmake -DCMAKE_BUILD_TYPE=Release $CMAKE_REQUIRED_PARAMS -DCMAKE_PREFIX_PATH=$INSTALL_PREFIX -DWITH_TESTS=OFF -DWITH_GFLAGS=OFF \ -DWITH_BENCHMARK_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_MD_LIBRARY=OFF -DWITH_RUNTIME_DEBUG=OFF -DROCKSDB_BUILD_SHARED=OFF -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_LIBURING=OFF \ diff --git a/c.h b/c.h index 11e4d26..701f145 100644 --- a/c.h +++ b/c.h @@ -1001,10 +1001,6 @@ extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_no_block_cache( extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_block_cache( rocksdb_block_based_table_options_t* options, rocksdb_cache_t* block_cache); extern ROCKSDB_LIBRARY_API void -rocksdb_block_based_options_set_block_cache_compressed( - rocksdb_block_based_table_options_t* options, - rocksdb_cache_t* block_cache_compressed); -extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_whole_key_filtering( rocksdb_block_based_table_options_t*, unsigned char); extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_format_version( diff --git a/options_block_based_table.go b/options_block_based_table.go index 35e79ec..db13298 100644 --- a/options_block_based_table.go +++ b/options_block_based_table.go @@ -168,14 +168,6 @@ func (opts *BlockBasedTableOptions) SetBlockCache(cache *Cache) { C.rocksdb_block_based_options_set_block_cache(opts.c, cache.c) } -// SetBlockCacheCompressed sets the cache for compressed blocks. -// If nil, rocksdb will not use a compressed block cache. -// Default: nil -func (opts *BlockBasedTableOptions) SetBlockCacheCompressed(cache *Cache) { - opts.compCache = cache - C.rocksdb_block_based_options_set_block_cache_compressed(opts.c, cache.c) -} - // SetWholeKeyFiltering specify if whole keys in the filter (not just prefixes) // should be placed. // This must generally be true for gets opts be efficient. @@ -271,6 +263,8 @@ func (opts *BlockBasedTableOptions) SetPartitionFilters(value bool) { // original size if malloc_usable_size says it is safe to do so. While this // can be considered bad practice, it should not produce undefined behavior // unless malloc_usable_size is buggy or broken. +// +// Default: false func (opts *BlockBasedTableOptions) SetOptimizeFiltersForMemory(value bool) { C.rocksdb_block_based_options_set_optimize_filters_for_memory(opts.c, boolToChar(value)) }