diff options
author | sdong <siying.d@fb.com> | 2023-01-27 13:14:19 -0800 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2023-01-27 13:14:19 -0800 |
commit | 4720ba4391eb016b05a30d09a8275624c3a4a87e (patch) | |
tree | c3f59f40a87cecfbd3cec83b7bc4d81e1fa91ed1 /memory | |
parent | 6943ff6e500213c0c2aa101038b991c0f9f1213d (diff) |
Remove RocksDB LITE (#11147)
Summary:
We haven't been actively mantaining RocksDB LITE recently and the size must have been gone up significantly. We are removing the support.
Most of changes were done through following comments:
unifdef -m -UROCKSDB_LITE `git grep -l ROCKSDB_LITE | egrep '[.](cc|h)'`
by Peter Dillinger. Others changes were manually applied to build scripts, CircleCI manifests, ROCKSDB_LITE is used in an expression and file db_stress_test_base.cc.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/11147
Test Plan: See CI
Reviewed By: pdillinger
Differential Revision: D42796341
fbshipit-source-id: 4920e15fc2060c2cd2221330a6d0e5e65d4b7fe2
Diffstat (limited to 'memory')
-rw-r--r-- | memory/jemalloc_nodump_allocator.cc | 2 | ||||
-rw-r--r-- | memory/memory_allocator.cc | 11 | ||||
-rw-r--r-- | memory/memory_allocator_test.cc | 4 |
3 files changed, 0 insertions, 17 deletions
diff --git a/memory/jemalloc_nodump_allocator.cc b/memory/jemalloc_nodump_allocator.cc index 62ee661d2..cdad14576 100644 --- a/memory/jemalloc_nodump_allocator.cc +++ b/memory/jemalloc_nodump_allocator.cc @@ -23,7 +23,6 @@ std::atomic<extent_alloc_t*> JemallocNodumpAllocator::original_alloc_{nullptr}; #endif // ROCKSDB_JEMALLOC_NODUMP_ALLOCATOR static std::unordered_map<std::string, OptionTypeInfo> jemalloc_type_info = { -#ifndef ROCKSDB_LITE {"limit_tcache_size", {offsetof(struct JemallocAllocatorOptions, limit_tcache_size), OptionType::kBoolean, OptionVerificationType::kNormal, @@ -36,7 +35,6 @@ static std::unordered_map<std::string, OptionTypeInfo> jemalloc_type_info = { {offsetof(struct JemallocAllocatorOptions, tcache_size_upper_bound), OptionType::kSizeT, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; bool JemallocNodumpAllocator::IsSupported(std::string* why) { #ifndef ROCKSDB_JEMALLOC diff --git a/memory/memory_allocator.cc b/memory/memory_allocator.cc index 34dce9bb6..d0de26b94 100644 --- a/memory/memory_allocator.cc +++ b/memory/memory_allocator.cc @@ -15,13 +15,10 @@ namespace ROCKSDB_NAMESPACE { namespace { static std::unordered_map<std::string, OptionTypeInfo> ma_wrapper_type_info = { -#ifndef ROCKSDB_LITE {"target", OptionTypeInfo::AsCustomSharedPtr<MemoryAllocator>( 0, OptionVerificationType::kByName, OptionTypeFlags::kNone)}, -#endif // ROCKSDB_LITE }; -#ifndef ROCKSDB_LITE static int RegisterBuiltinAllocators(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory<MemoryAllocator>( @@ -61,7 +58,6 @@ static int RegisterBuiltinAllocators(ObjectLibrary& library, size_t num_types; return static_cast<int>(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE } // namespace MemoryAllocatorWrapper::MemoryAllocatorWrapper( @@ -73,17 +69,10 @@ MemoryAllocatorWrapper::MemoryAllocatorWrapper( Status MemoryAllocator::CreateFromString( const ConfigOptions& options, const std::string& value, std::shared_ptr<MemoryAllocator>* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinAllocators(*(ObjectLibrary::Default().get()), ""); }); -#else - if (value == DefaultMemoryAllocator::kClassName()) { - result->reset(new DefaultMemoryAllocator()); - return Status::OK(); - } -#endif // ROCKSDB_LITE ConfigOptions copy = options; copy.invoke_prepare_options = true; return LoadManagedObject<MemoryAllocator>(copy, value, result); diff --git a/memory/memory_allocator_test.cc b/memory/memory_allocator_test.cc index 6afde7165..6616e1c3b 100644 --- a/memory/memory_allocator_test.cc +++ b/memory/memory_allocator_test.cc @@ -20,7 +20,6 @@ namespace ROCKSDB_NAMESPACE { // TODO: the tests do not work in LITE mode due to relying on // `CreateFromString()` to create non-default memory allocators. -#ifndef ROCKSDB_LITE class MemoryAllocatorTest : public testing::Test, @@ -63,11 +62,9 @@ TEST_P(MemoryAllocatorTest, CreateAllocator) { } else { ASSERT_OK(s); ASSERT_NE(orig, nullptr); -#ifndef ROCKSDB_LITE std::string str = orig->ToString(config_options); ASSERT_OK(MemoryAllocator::CreateFromString(config_options, str, ©)); ASSERT_EQ(orig, copy); -#endif // ROCKSDB_LITE } } @@ -229,7 +226,6 @@ INSTANTIATE_TEST_CASE_P( JemallocNodumpAllocator::IsSupported()))); #endif // ROCKSDB_JEMALLOC -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE |