diff --git a/build.sh b/build.sh index 2079d60..c14c794 100755 --- 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="8.3.3" +rocksdb_version="8.4.4" 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 6e0ad08..cb0c224 100644 --- a/c.h +++ b/c.h @@ -1616,6 +1616,10 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_row_cache( extern ROCKSDB_LIBRARY_API void rocksdb_options_add_compact_on_deletion_collector_factory( rocksdb_options_t*, size_t window_size, size_t num_dels_trigger); +extern ROCKSDB_LIBRARY_API void +rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio( + rocksdb_options_t*, size_t window_size, size_t num_dels_trigger, + double deletion_ratio); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_manual_wal_flush( rocksdb_options_t* opt, unsigned char); extern ROCKSDB_LIBRARY_API unsigned char rocksdb_options_get_manual_wal_flush( diff --git a/cache.go b/cache.go index 2f6ea21..b6f0044 100644 --- a/cache.go +++ b/cache.go @@ -47,7 +47,7 @@ func (c *Cache) GetPinnedUsage() uint64 { return uint64(C.rocksdb_cache_get_pinned_usage(c.c)) } -// TODO: try to re-enable at next release of RocksDB +// TODO: try to re-enable later, along with next release of RocksDB // // GetTableAddressCount returns the number of ways the hash function is divided for addressing // // entries. Zero means "not supported." This is used for inspecting the load diff --git a/options.go b/options.go index 5d56a85..914774d 100644 --- a/options.go +++ b/options.go @@ -1580,6 +1580,12 @@ func (opts *Options) AddCompactOnDeletionCollectorFactory(windowSize, numDelsTri C.rocksdb_options_add_compact_on_deletion_collector_factory(opts.c, C.size_t(windowSize), C.size_t(numDelsTrigger)) } +// AddCompactOnDeletionCollectorFactoryWithRatio similar to AddCompactOnDeletionCollectorFactory +// with specific deletion ratio. +func (opts *Options) AddCompactOnDeletionCollectorFactoryWithRatio(windowSize, numDelsTrigger uint, deletionRatio float64) { + C.rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio(opts.c, C.size_t(windowSize), C.size_t(numDelsTrigger), C.double(deletionRatio)) +} + // SetManualWALFlush if true WAL is not flushed automatically after each write. Instead it // relies on manual invocation of db.FlushWAL to write the WAL buffer to its // file. diff --git a/options_test.go b/options_test.go index 6a8978f..92ff7f2 100644 --- a/options_test.go +++ b/options_test.go @@ -243,6 +243,7 @@ func TestOptions(t *testing.T) { require.EqualValues(t, 12, opts.GetCompressionOptionsParallelThreads()) opts.AddCompactOnDeletionCollectorFactory(12, 13) + opts.AddCompactOnDeletionCollectorFactoryWithRatio(12, 13, 5.5) require.EqualValues(t, 0, opts.GetCompressionOptionsMaxDictBufferBytes()) opts.SetCompressionOptionsMaxDictBufferBytes(213 << 10)