From 4720ba4391eb016b05a30d09a8275624c3a4a87e Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 27 Jan 2023 13:14:19 -0800 Subject: [PATCH] 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 --- .circleci/config.yml | 23 --- CMakeLists.txt | 6 - HISTORY.md | 1 + INSTALL.md | 2 +- Makefile | 39 ----- ROCKSDB_LITE.md | 21 --- build_tools/build_detect_platform | 2 +- cache/cache.cc | 13 -- cache/cache_bench_tool.cc | 4 - cache/compressed_secondary_cache_test.cc | 2 - cache/lru_cache_test.cc | 2 - db/blob/blob_file_completion_callback.h | 17 -- db/blob/blob_source.cc | 2 - db/blob/blob_source_test.cc | 2 - db/blob/db_blob_basic_test.cc | 8 - db/blob/db_blob_compaction_test.cc | 14 -- db/blob/db_blob_corruption_test.cc | 2 - db/blob/db_blob_index_test.cc | 6 - db/builder.cc | 2 - db/c.cc | 2 - db/c_test.c | 11 -- db/column_family.cc | 13 -- db/column_family.h | 2 - db/column_family_test.cc | 71 -------- db/compact_files_test.cc | 11 -- db/compaction/compaction_job.cc | 20 --- db/compaction/compaction_job_stats_test.cc | 10 -- db/compaction/compaction_job_test.cc | 11 -- db/compaction/compaction_picker.cc | 2 - db/compaction/compaction_picker.h | 6 - db/compaction/compaction_picker_fifo.cc | 2 - db/compaction/compaction_picker_fifo.h | 2 - db/compaction/compaction_picker_test.cc | 5 - db/compaction/compaction_picker_universal.cc | 2 - db/compaction/compaction_picker_universal.h | 2 - db/compaction/compaction_service_job.cc | 2 - db/compaction/compaction_service_test.cc | 11 -- db/compaction/sst_partitioner.cc | 6 - db/compaction/subcompaction_state.h | 2 - db/compaction/tiered_compaction_test.cc | 8 - db/convenience.cc | 2 - db/corruption_test.cc | 10 -- db/cuckoo_table_db_test.cc | 10 -- db/db_basic_test.cc | 27 ---- db/db_block_cache_test.cc | 8 - db/db_bloom_filter_test.cc | 24 --- db/db_compaction_filter_test.cc | 6 - db/db_compaction_test.cc | 8 - db/db_dynamic_level_test.cc | 8 - db/db_encryption_test.cc | 4 - db/db_filesnapshot.cc | 2 - db/db_flush_test.cc | 33 ---- db/db_impl/compacted_db_impl.cc | 2 - db/db_impl/compacted_db_impl.h | 4 - db/db_impl/db_impl.cc | 72 --------- db/db_impl/db_impl.h | 22 --- db/db_impl/db_impl_compaction_flush.cc | 66 -------- db/db_impl/db_impl_debug.cc | 2 - db/db_impl/db_impl_experimental.cc | 2 - db/db_impl/db_impl_files.cc | 4 - db/db_impl/db_impl_open.cc | 16 -- db/db_impl/db_impl_readonly.cc | 17 -- db/db_impl/db_impl_readonly.h | 4 - db/db_impl/db_impl_secondary.cc | 18 --- db/db_impl/db_impl_secondary.h | 4 - db/db_impl/db_impl_write.cc | 8 - db/db_io_failure_test.cc | 4 - db/db_iter.cc | 4 - db/db_iter.h | 6 - db/db_iterator_test.cc | 8 - db/db_log_iter_test.cc | 8 - db/db_logical_block_size_cache_test.cc | 16 -- db/db_merge_operand_test.cc | 2 - db/db_merge_operator_test.cc | 4 - db/db_options_test.cc | 4 - db/db_properties_test.cc | 6 - db/db_range_del_test.cc | 10 -- db/db_rate_limiter_test.cc | 15 -- db/db_readonly_with_timestamp_test.cc | 4 - db/db_secondary_test.cc | 2 - db/db_sst_test.cc | 4 - db/db_statistics_test.cc | 2 - db/db_table_properties_test.cc | 2 - db/db_tailing_iter_test.cc | 8 - db/db_test.cc | 66 +------- db/db_test2.cc | 77 --------- db/db_test_util.cc | 29 ---- db/db_test_util.h | 8 - db/db_universal_compaction_test.cc | 8 - db/db_wal_test.cc | 8 - db/db_with_timestamp_basic_test.cc | 6 - db/db_with_timestamp_compaction_test.cc | 2 - db/db_write_buffer_manager_test.cc | 2 - db/deletefile_test.cc | 11 -- db/error_handler.cc | 27 ---- db/error_handler_fs_test.cc | 12 -- db/event_helpers.cc | 48 ------ db/event_helpers.h | 4 - db/experimental.cc | 14 -- db/external_sst_file_basic_test.cc | 2 - db/external_sst_file_ingestion_job.cc | 2 - db/external_sst_file_test.cc | 12 -- db/flush_job.cc | 6 - db/flush_job.h | 4 - db/flush_job_test.cc | 2 - db/forward_iterator.cc | 2 - db/forward_iterator.h | 2 - db/forward_iterator_bench.cc | 4 +- db/import_column_family_job.cc | 2 - db/import_column_family_test.cc | 12 -- db/internal_stats.cc | 8 - db/internal_stats.h | 151 ------------------ db/job_context.h | 9 +- db/listener_test.cc | 2 - db/malloc_stats.cc | 2 - db/malloc_stats.h | 2 - db/memtable.cc | 4 - db/memtable.h | 4 - db/memtable_list.cc | 8 - db/memtable_list_test.cc | 2 - db/merge_test.cc | 8 - db/obsolete_files_test.cc | 11 -- db/options_file_test.cc | 10 -- db/perf_context_test.cc | 4 - db/periodic_task_scheduler.cc | 2 - db/periodic_task_scheduler.h | 2 - db/periodic_task_scheduler_test.cc | 2 - db/plain_table_db_test.cc | 10 -- db/prefix_test.cc | 12 -- db/repair.cc | 2 - db/repair_test.cc | 12 -- db/seqno_time_test.cc | 2 - db/snapshot_checker.h | 2 - db/table_cache.cc | 10 -- db/table_cache_sync_and_async.h | 4 - db/table_properties_collector_test.cc | 4 - db/transaction_log_impl.cc | 2 - db/transaction_log_impl.h | 2 - db/version_set.cc | 2 - db/version_set.h | 2 - db/version_set_test.cc | 2 - db/wal_manager.cc | 2 - db/wal_manager.h | 2 - db/wal_manager_test.cc | 10 -- db/write_batch_test.cc | 2 - db/write_callback_test.cc | 11 -- db_stress_tool/cf_consistency_stress.cc | 6 - db_stress_tool/db_stress_common.h | 4 - db_stress_tool/db_stress_gflags.cc | 6 - db_stress_tool/db_stress_listener.cc | 2 - db_stress_tool/db_stress_listener.h | 2 - db_stress_tool/db_stress_test_base.cc | 117 +------------- db_stress_tool/db_stress_test_base.h | 16 -- db_stress_tool/expected_state.cc | 12 -- db_stress_tool/multi_ops_txns_stress.cc | 61 ------- db_stress_tool/multi_ops_txns_stress.h | 8 - db_stress_tool/no_batched_ops_stress.cc | 37 ----- env/composite_env.cc | 10 -- env/composite_env_wrapper.h | 2 - env/env.cc | 21 --- env/env_basic_test.cc | 4 - env/env_chroot.cc | 4 +- env/env_chroot.h | 4 +- env/env_encryption.cc | 4 - env/env_encryption_ctr.h | 2 - env/env_test.cc | 20 +-- env/file_system.cc | 8 - env/fs_posix.cc | 18 --- env/fs_readonly.h | 2 - env/fs_remap.cc | 2 - env/fs_remap.h | 2 - env/mock_env.cc | 12 -- examples/optimistic_transaction_example.cc | 2 - examples/transaction_example.cc | 2 - file/delete_scheduler.cc | 2 - file/delete_scheduler.h | 2 - file/delete_scheduler_test.cc | 7 - file/file_util.cc | 9 -- file/prefetch_test.cc | 10 -- file/random_access_file_reader.cc | 18 --- file/random_access_file_reader.h | 8 - file/random_access_file_reader_test.cc | 2 - file/sequence_file_reader.cc | 8 - file/sequence_file_reader.h | 10 -- file/sst_file_manager_impl.cc | 18 --- file/sst_file_manager_impl.h | 2 - file/writable_file_writer.cc | 36 ----- file/writable_file_writer.h | 16 -- include/rocksdb/advanced_options.h | 5 +- include/rocksdb/configurable.h | 10 -- include/rocksdb/convenience.h | 4 - include/rocksdb/customizable.h | 4 - include/rocksdb/db.h | 21 --- include/rocksdb/db_dump_tool.h | 2 - include/rocksdb/env.h | 2 - include/rocksdb/env_encryption.h | 2 - include/rocksdb/file_system.h | 2 - include/rocksdb/ldb_tool.h | 2 - include/rocksdb/listener.h | 7 - include/rocksdb/memtablerep.h | 2 - include/rocksdb/options.h | 16 -- include/rocksdb/sst_dump_tool.h | 2 - include/rocksdb/sst_file_reader.h | 2 - include/rocksdb/sst_file_writer.h | 2 - include/rocksdb/statistics.h | 2 - include/rocksdb/system_clock.h | 2 - include/rocksdb/table.h | 4 - include/rocksdb/thread_status.h | 2 +- include/rocksdb/utilities/backup_engine.h | 2 - include/rocksdb/utilities/cache_dump_load.h | 2 - include/rocksdb/utilities/checkpoint.h | 2 - include/rocksdb/utilities/customizable_util.h | 18 --- include/rocksdb/utilities/db_ttl.h | 2 - include/rocksdb/utilities/debug.h | 2 - include/rocksdb/utilities/env_mirror.h | 2 - include/rocksdb/utilities/ldb_cmd.h | 2 - include/rocksdb/utilities/memory_util.h | 2 - include/rocksdb/utilities/object_registry.h | 2 - .../utilities/optimistic_transaction_db.h | 2 - include/rocksdb/utilities/options_util.h | 2 - include/rocksdb/utilities/replayer.h | 2 - include/rocksdb/utilities/stackable_db.h | 4 - .../utilities/table_properties_collectors.h | 2 - include/rocksdb/utilities/transaction.h | 2 - include/rocksdb/utilities/transaction_db.h | 2 - .../rocksdb/utilities/transaction_db_mutex.h | 2 - .../utilities/write_batch_with_index.h | 2 - .../main/java/org/rocksdb/ReadOptions.java | 8 - logging/auto_roll_logger.cc | 4 - logging/auto_roll_logger.h | 2 - logging/auto_roll_logger_test.cc | 11 -- memory/jemalloc_nodump_allocator.cc | 2 - memory/memory_allocator.cc | 11 -- memory/memory_allocator_test.cc | 4 - memtable/hash_linklist_rep.cc | 2 - memtable/hash_skiplist_rep.cc | 2 - memtable/memtablerep_bench.cc | 2 - memtable/skiplistrep.cc | 2 - memtable/vectorrep.cc | 2 - memtable/write_buffer_manager.cc | 12 -- memtable/write_buffer_manager_test.cc | 2 - monitoring/statistics.cc | 6 - monitoring/statistics_test.cc | 4 - monitoring/stats_history_test.cc | 2 - options/cf_options.cc | 4 - options/cf_options.h | 2 - options/configurable.cc | 55 ------- options/configurable_helper.h | 2 - options/configurable_test.cc | 20 --- options/configurable_test.h | 10 -- options/customizable.cc | 6 - options/customizable_test.cc | 70 -------- options/db_options.cc | 8 - options/db_options.h | 4 - options/options.cc | 2 - options/options_helper.cc | 12 -- options/options_helper.h | 6 - options/options_parser.cc | 2 - options/options_parser.h | 2 - options/options_settable_test.cc | 2 - options/options_test.cc | 27 ---- port/stack_trace.cc | 3 +- table/adaptive/adaptive_table_factory.cc | 2 - table/adaptive/adaptive_table_factory.h | 2 - .../block_based/block_based_table_factory.cc | 6 - table/block_based/block_based_table_factory.h | 2 - table/block_based/block_based_table_reader.cc | 2 - .../block_based_table_reader_test.cc | 11 -- table/block_based/filter_policy.cc | 7 - table/block_based/flush_block_policy.cc | 10 -- table/block_fetcher_test.cc | 2 - table/cuckoo/cuckoo_table_builder.cc | 2 - table/cuckoo/cuckoo_table_builder.h | 2 - table/cuckoo/cuckoo_table_builder_test.cc | 10 -- table/cuckoo/cuckoo_table_factory.cc | 4 - table/cuckoo/cuckoo_table_factory.h | 2 - table/cuckoo/cuckoo_table_reader.cc | 2 - table/cuckoo/cuckoo_table_reader.h | 2 - table/cuckoo/cuckoo_table_reader_test.cc | 10 -- table/format.cc | 6 - table/get_context.cc | 14 -- table/plain/plain_table_builder.cc | 2 - table/plain/plain_table_builder.h | 2 - table/plain/plain_table_factory.cc | 31 ---- table/plain/plain_table_factory.h | 2 - table/plain/plain_table_index.cc | 2 - table/plain/plain_table_index.h | 2 - table/plain/plain_table_key_coding.cc | 2 - table/plain/plain_table_key_coding.h | 2 - table/plain/plain_table_reader.cc | 2 - table/plain/plain_table_reader.h | 2 - table/sst_file_dumper.cc | 2 - table/sst_file_dumper.h | 2 - table/sst_file_reader.cc | 2 - table/sst_file_reader_test.cc | 11 -- table/sst_file_writer.cc | 2 - table/table_factory.cc | 2 - table/table_reader_bench.cc | 10 -- table/table_test.cc | 19 +-- test_util/testutil.cc | 16 -- test_util/testutil.h | 2 - test_util/transaction_test_util.cc | 2 - test_util/transaction_test_util.h | 2 - tools/blob_dump.cc | 8 - .../block_cache_trace_analyzer.cc | 2 - .../block_cache_trace_analyzer_test.cc | 9 -- .../block_cache_trace_analyzer_tool.cc | 8 - tools/db_bench_tool.cc | 129 --------------- tools/db_repl_stress.cc | 8 - tools/db_sanity_test.cc | 4 - tools/dump/db_dump_tool.cc | 2 - tools/dump/rocksdb_dump.cc | 7 +- tools/dump/rocksdb_undump.cc | 7 +- tools/io_tracer_parser.cc | 8 - tools/io_tracer_parser_test.cc | 8 - tools/io_tracer_parser_tool.cc | 2 - tools/io_tracer_parser_tool.h | 2 - tools/ldb.cc | 8 - tools/ldb_cmd.cc | 2 - tools/ldb_cmd_test.cc | 10 -- tools/ldb_tool.cc | 2 - tools/reduce_levels_test.cc | 10 -- tools/simulated_hybrid_file_system.cc | 2 - tools/simulated_hybrid_file_system.h | 2 - tools/sst_dump.cc | 8 - tools/sst_dump_test.cc | 10 -- tools/sst_dump_tool.cc | 2 - tools/trace_analyzer.cc | 8 - tools/trace_analyzer_test.cc | 10 -- tools/trace_analyzer_tool.cc | 2 - tools/trace_analyzer_tool.h | 2 - tools/write_stress.cc | 4 - util/autovector.h | 13 -- util/autovector_test.cc | 7 - util/build_version.cc.in | 2 - util/compaction_job_stats_impl.cc | 8 - util/comparator.cc | 8 - util/duplicate_detector.h | 2 - util/file_checksum_helper.cc | 4 - util/file_reader_writer_test.cc | 8 - util/filter_bench.cc | 6 +- util/slice.cc | 38 ----- util/string_util.cc | 2 - util/string_util.h | 2 - util/thread_local_test.cc | 4 - utilities/backup/backup_engine.cc | 2 - utilities/backup/backup_engine_impl.h | 2 - utilities/backup/backup_engine_test.cc | 6 +- utilities/blob_db/blob_compaction_filter.cc | 2 - utilities/blob_db/blob_compaction_filter.h | 2 - utilities/blob_db/blob_db.cc | 2 - utilities/blob_db/blob_db.h | 2 - utilities/blob_db/blob_db_gc_stats.h | 2 - utilities/blob_db/blob_db_impl.cc | 2 - utilities/blob_db/blob_db_impl.h | 2 - .../blob_db/blob_db_impl_filesnapshot.cc | 2 - utilities/blob_db/blob_db_iterator.h | 2 - utilities/blob_db/blob_db_listener.h | 2 - utilities/blob_db/blob_db_test.cc | 10 -- utilities/blob_db/blob_dump_tool.cc | 2 - utilities/blob_db/blob_dump_tool.h | 2 - utilities/blob_db/blob_file.cc | 2 - utilities/blob_db/blob_file.h | 2 - utilities/cache_dump_load.cc | 2 - utilities/cache_dump_load_impl.cc | 2 - utilities/cache_dump_load_impl.h | 2 - .../cassandra/cassandra_compaction_filter.cc | 4 - .../cassandra/cassandra_functional_test.cc | 2 - utilities/cassandra/cassandra_options.h | 2 - utilities/cassandra/merge_operator.cc | 2 - utilities/checkpoint/checkpoint_impl.cc | 2 - utilities/checkpoint/checkpoint_impl.h | 2 - utilities/checkpoint/checkpoint_test.cc | 10 -- utilities/compaction_filters.cc | 4 - .../remove_emptyvalue_compactionfilter.cc | 2 - .../remove_emptyvalue_compactionfilter.h | 2 - utilities/debug.cc | 2 - utilities/env_mirror.cc | 2 - utilities/env_mirror_test.cc | 10 -- utilities/env_timed.cc | 6 - utilities/env_timed.h | 2 - utilities/env_timed_test.cc | 10 -- utilities/memory/memory_test.cc | 9 -- utilities/memory/memory_util.cc | 2 - utilities/merge_operators.cc | 19 --- .../string_append/stringappend.cc | 2 - .../string_append/stringappend2.cc | 2 - .../string_append/stringappend_test.cc | 4 - utilities/object_registry.cc | 2 - utilities/object_registry_test.cc | 10 -- .../option_change_migration.cc | 10 -- .../option_change_migration_test.cc | 2 - utilities/options/options_util.cc | 2 - utilities/options/options_util_test.cc | 9 -- .../persistent_cache/block_cache_tier.cc | 2 - utilities/persistent_cache/block_cache_tier.h | 2 - .../persistent_cache/block_cache_tier_file.cc | 2 - .../persistent_cache/block_cache_tier_file.h | 2 - .../block_cache_tier_metadata.cc | 2 - .../block_cache_tier_metadata.h | 2 - utilities/persistent_cache/hash_table.h | 2 - .../persistent_cache/hash_table_bench.cc | 2 +- .../persistent_cache/hash_table_evictable.h | 2 - utilities/persistent_cache/hash_table_test.cc | 2 - utilities/persistent_cache/lrulist.h | 2 - .../persistent_cache_bench.cc | 4 - .../persistent_cache/persistent_cache_test.cc | 4 - .../persistent_cache/persistent_cache_test.h | 2 - .../persistent_cache/persistent_cache_tier.cc | 2 - .../persistent_cache/persistent_cache_tier.h | 2 - .../persistent_cache/volatile_tier_impl.cc | 2 - .../persistent_cache/volatile_tier_impl.h | 2 - .../compact_on_deletion_collector.cc | 6 - .../compact_on_deletion_collector.h | 2 - .../compact_on_deletion_collector_test.cc | 7 - utilities/trace/replayer_impl.cc | 2 - utilities/trace/replayer_impl.h | 2 - utilities/transactions/lock/lock_manager.cc | 2 - utilities/transactions/lock/lock_manager.h | 2 - utilities/transactions/lock/lock_tracker.h | 2 - .../lock/point/point_lock_manager.cc | 2 - .../lock/point/point_lock_manager.h | 2 - .../lock/point/point_lock_manager_test.cc | 11 -- .../lock/point/point_lock_tracker.cc | 2 - .../lock/point/point_lock_tracker.h | 2 - .../lock/range/range_lock_manager.h | 2 - .../lock/range/range_locking_test.cc | 11 -- .../lib/locktree/concurrent_tree.cc | 2 - .../range/range_tree/lib/locktree/keyrange.cc | 2 - .../range_tree/lib/locktree/lock_request.cc | 2 - .../range/range_tree/lib/locktree/locktree.cc | 2 - .../range/range_tree/lib/locktree/manager.cc | 2 - .../range_tree/lib/locktree/range_buffer.cc | 2 - .../range/range_tree/lib/locktree/treenode.cc | 2 - .../range_tree/lib/locktree/txnid_set.cc | 2 - .../lock/range/range_tree/lib/locktree/wfg.cc | 2 - .../range/range_tree/lib/standalone_port.cc | 2 - .../lock/range/range_tree/lib/util/dbt.cc | 2 - .../range/range_tree/lib/util/memarena.cc | 2 - .../range_tree/range_tree_lock_manager.cc | 2 - .../range_tree/range_tree_lock_manager.h | 2 - .../range_tree/range_tree_lock_tracker.cc | 2 - .../transactions/optimistic_transaction.cc | 2 - .../transactions/optimistic_transaction.h | 2 - .../optimistic_transaction_db_impl.cc | 2 - .../optimistic_transaction_db_impl.h | 2 - .../optimistic_transaction_test.cc | 12 -- .../transactions/pessimistic_transaction.cc | 2 - .../transactions/pessimistic_transaction.h | 2 - .../pessimistic_transaction_db.cc | 2 - .../transactions/pessimistic_transaction_db.h | 2 - utilities/transactions/snapshot_checker.cc | 16 -- .../transactions/timestamped_snapshot_test.cc | 9 -- utilities/transactions/transaction_base.cc | 2 - utilities/transactions/transaction_base.h | 2 - .../transactions/transaction_db_mutex_impl.cc | 2 - .../transactions/transaction_db_mutex_impl.h | 2 - utilities/transactions/transaction_test.cc | 11 -- utilities/transactions/transaction_util.cc | 2 - utilities/transactions/transaction_util.h | 2 - .../write_committed_transaction_ts_test.cc | 10 -- .../write_prepared_transaction_test.cc | 11 -- utilities/transactions/write_prepared_txn.cc | 2 - utilities/transactions/write_prepared_txn.h | 2 - .../transactions/write_prepared_txn_db.cc | 2 - .../transactions/write_prepared_txn_db.h | 2 - .../write_unprepared_transaction_test.cc | 11 -- .../transactions/write_unprepared_txn.cc | 2 - utilities/transactions/write_unprepared_txn.h | 2 - .../transactions/write_unprepared_txn_db.cc | 2 - .../transactions/write_unprepared_txn_db.h | 2 - utilities/ttl/db_ttl_impl.cc | 2 - utilities/ttl/db_ttl_impl.h | 2 - utilities/ttl/ttl_test.cc | 10 -- .../write_batch_with_index.cc | 2 - .../write_batch_with_index_internal.cc | 2 - .../write_batch_with_index_internal.h | 2 - .../write_batch_with_index_test.cc | 10 -- 478 files changed, 36 insertions(+), 3608 deletions(-) delete mode 100644 ROCKSDB_LITE.md diff --git a/.circleci/config.yml b/.circleci/config.yml index bba65c8aa20..120cdf88bbc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -302,27 +302,6 @@ jobs: - run: USE_RTTI=1 DEBUG_LEVEL=0 make V=1 -j16 static_lib tools db_bench - run: if ./db_stress --version; then false; else true; fi # ensure without gflags - build-linux-lite: - executor: linux-docker - resource_class: large - steps: - - pre-steps - - run: LITE=1 make V=1 J=8 -j8 check - - post-steps - - build-linux-lite-release: - executor: linux-docker - resource_class: large - steps: - - checkout # check out the code in the project directory - - run: LITE=1 make V=1 -j8 release - - run: ./db_stress --version # ensure with gflags - - run: make clean - - run: apt-get remove -y libgflags-dev - - run: LITE=1 make V=1 -j8 release - - run: if ./db_stress --version; then false; else true; fi # ensure without gflags - - post-steps - build-linux-clang-no_test_run: executor: linux-docker resource_class: xlarge @@ -821,7 +800,6 @@ workflows: - build-linux-cmake-with-folly-coroutines - build-linux-cmake-with-benchmark - build-linux-encrypted_env-no_compression - - build-linux-lite jobs-linux-run-tests-san: jobs: - build-linux-clang10-asan @@ -832,7 +810,6 @@ workflows: jobs: - build-linux-release - build-linux-release-rtti - - build-linux-lite-release - build-examples - build-fuzzers - build-linux-clang-no_test_run diff --git a/CMakeLists.txt b/CMakeLists.txt index d0112580d50..c72e7a0dd53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -496,12 +496,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-memcmp") endif() -option(ROCKSDB_LITE "Build RocksDBLite version" OFF) -if(ROCKSDB_LITE) - add_definitions(-DROCKSDB_LITE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -Os") -endif() - if(CMAKE_SYSTEM_NAME MATCHES "Cygwin") add_definitions(-fno-builtin-memcmp -DCYGWIN) elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") diff --git a/HISTORY.md b/HISTORY.md index d078b7b66e9..180e8c4356e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,6 +8,7 @@ * Fixed a data race on `ColumnFamilyData::flush_reason` caused by concurrent flushes. ### Feature Removal +* Remove RocksDB Lite. * The feature block_cache_compressed is removed. Statistics related to it are removed too. * Remove deprecated Env::LoadEnv(). Use Env::CreateFromString() instead. * Remove deprecated FileSystem::Load(). Use FileSystem::CreateFromString() instead. diff --git a/INSTALL.md b/INSTALL.md index 7d3b147796c..fd63080a1aa 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -178,7 +178,7 @@ to build a portable binary, add `PORTABLE=1` before your make commands, like thi gmake rocksdbjava * **iOS**: - * Run: `TARGET_OS=IOS make static_lib`. When building the project which uses rocksdb iOS library, make sure to define two important pre-processing macros: `ROCKSDB_LITE` and `IOS_CROSS_COMPILE`. + * Run: `TARGET_OS=IOS make static_lib`. When building the project which uses rocksdb iOS library, make sure to define an important pre-processing macros: `IOS_CROSS_COMPILE`. * **Windows** (Visual Studio 2017 to up): * Read and follow the instructions at CMakeLists.txt diff --git a/Makefile b/Makefile index 32d1fcd6b2e..9964d7d3efb 100644 --- a/Makefile +++ b/Makefile @@ -83,27 +83,9 @@ endif $(info $$DEBUG_LEVEL is ${DEBUG_LEVEL}) -# Lite build flag. -LITE ?= 0 -ifeq ($(LITE), 0) -ifneq ($(filter -DROCKSDB_LITE,$(OPT)),) - # Be backward compatible and support older format where OPT=-DROCKSDB_LITE is - # specified instead of LITE=1 on the command line. - LITE=1 -endif -else ifeq ($(LITE), 1) -ifeq ($(filter -DROCKSDB_LITE,$(OPT)),) - OPT += -DROCKSDB_LITE -endif -endif - # Figure out optimize level. ifneq ($(DEBUG_LEVEL), 2) -ifeq ($(LITE), 0) OPTIMIZE_LEVEL ?= -O2 -else - OPTIMIZE_LEVEL ?= -Os -endif endif # `OPTIMIZE_LEVEL` is empty when the user does not set it and `DEBUG_LEVEL=2`. # In that case, the compiler default (`-O0` for gcc and clang) will be used. @@ -337,13 +319,6 @@ endif ifeq ($(PLATFORM), OS_SOLARIS) PLATFORM_CXXFLAGS += -D _GLIBCXX_USE_C99 endif -ifneq ($(filter -DROCKSDB_LITE,$(OPT)),) - # found - CFLAGS += -fno-exceptions - CXXFLAGS += -fno-exceptions - # LUA is not supported under ROCKSDB_LITE - LUA_PATH = -endif ifeq ($(LIB_MODE),shared) # So that binaries are executable from build location, in addition to install location @@ -1082,13 +1057,11 @@ check: all rm -rf $(TEST_TMPDIR) ifneq ($(PLATFORM), OS_AIX) $(PYTHON) tools/check_all_python.py -ifeq ($(filter -DROCKSDB_LITE,$(OPT)),) ifndef ASSERT_STATUS_CHECKED # not yet working with these tests $(PYTHON) tools/ldb_test.py sh tools/rocksdb_dump_test.sh endif endif -endif ifndef SKIP_FORMAT_BUCK_CHECKS $(MAKE) check-format $(MAKE) check-buck-targets @@ -2489,18 +2462,6 @@ build_size: $(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib $$(stat --printf="%s" `readlink -f librocksdb.so`) strip `readlink -f librocksdb.so` $(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib_stripped $$(stat --printf="%s" `readlink -f librocksdb.so`) - # === lite build, static === - $(MAKE) clean - $(MAKE) LITE=1 static_lib - $(REPORT_BUILD_STATISTIC) rocksdb.build_size.static_lib_lite $$(stat --printf="%s" librocksdb.a) - strip librocksdb.a - $(REPORT_BUILD_STATISTIC) rocksdb.build_size.static_lib_lite_stripped $$(stat --printf="%s" librocksdb.a) - # === lite build, shared === - $(MAKE) clean - $(MAKE) LITE=1 shared_lib - $(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib_lite $$(stat --printf="%s" `readlink -f librocksdb.so`) - strip `readlink -f librocksdb.so` - $(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib_lite_stripped $$(stat --printf="%s" `readlink -f librocksdb.so`) # --------------------------------------------------------------------------- # Platform-specific compilation diff --git a/ROCKSDB_LITE.md b/ROCKSDB_LITE.md deleted file mode 100644 index 166426c6009..00000000000 --- a/ROCKSDB_LITE.md +++ /dev/null @@ -1,21 +0,0 @@ -# RocksDBLite - -RocksDBLite is a project focused on mobile use cases, which don't need a lot of fancy things we've built for server workloads and they are very sensitive to binary size. For that reason, we added a compile flag ROCKSDB_LITE that comments out a lot of the nonessential code and keeps the binary lean. - -Some examples of the features disabled by ROCKSDB_LITE: -* compiled-in support for LDB tool -* No backup engine -* No support for replication (which we provide in form of TransactionalIterator) -* No advanced monitoring tools -* No special-purpose memtables that are highly optimized for specific use cases -* No Transactions - -When adding a new big feature to RocksDB, please add ROCKSDB_LITE compile guard if: -* Nobody from mobile really needs your feature, -* Your feature is adding a lot of weight to the binary. - -Don't add ROCKSDB_LITE compile guard if: -* It would introduce a lot of code complexity. Compile guards make code harder to read. It's a trade-off. -* Your feature is not adding a lot of weight. - -If unsure, ask. :) diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index 15129411ac7..043f9c42225 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -154,7 +154,7 @@ case "$TARGET_OS" in ;; IOS) PLATFORM=IOS - COMMON_FLAGS="$COMMON_FLAGS -DOS_MACOSX -DIOS_CROSS_COMPILE -DROCKSDB_LITE" + COMMON_FLAGS="$COMMON_FLAGS -DOS_MACOSX -DIOS_CROSS_COMPILE " PLATFORM_SHARED_EXT=dylib PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name " CROSS_COMPILE=true diff --git a/cache/cache.cc b/cache/cache.cc index 7d23fb75797..8b02354f658 100644 --- a/cache/cache.cc +++ b/cache/cache.cc @@ -16,7 +16,6 @@ #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE static std::unordered_map lru_cache_options_type_info = { {"capacity", @@ -64,7 +63,6 @@ static std::unordered_map OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kMutable}}, }; -#endif // ROCKSDB_LITE Status SecondaryCache::CreateFromString( const ConfigOptions& config_options, const std::string& value, @@ -75,7 +73,6 @@ Status SecondaryCache::CreateFromString( Status status; std::shared_ptr sec_cache; -#ifndef ROCKSDB_LITE CompressedSecondaryCacheOptions sec_cache_opts; status = OptionTypeInfo::ParseStruct(config_options, "", &comp_sec_cache_options_type_info, "", @@ -84,11 +81,6 @@ Status SecondaryCache::CreateFromString( sec_cache = NewCompressedSecondaryCache(sec_cache_opts); } -#else - (void)config_options; - status = Status::NotSupported( - "Cannot load compressed secondary cache in LITE mode ", args); -#endif //! ROCKSDB_LITE if (status.ok()) { result->swap(sec_cache); @@ -108,7 +100,6 @@ Status Cache::CreateFromString(const ConfigOptions& config_options, if (value.find('=') == std::string::npos) { cache = NewLRUCache(ParseSizeT(value)); } else { -#ifndef ROCKSDB_LITE LRUCacheOptions cache_opts; status = OptionTypeInfo::ParseStruct(config_options, "", &lru_cache_options_type_info, "", @@ -116,10 +107,6 @@ Status Cache::CreateFromString(const ConfigOptions& config_options, if (status.ok()) { cache = NewLRUCache(cache_opts); } -#else - (void)config_options; - status = Status::NotSupported("Cannot load cache in LITE mode ", value); -#endif //! ROCKSDB_LITE } if (status.ok()) { result->swap(cache); diff --git a/cache/cache_bench_tool.cc b/cache/cache_bench_tool.cc index 1dfbfe3c7ff..3ba9602bd09 100644 --- a/cache/cache_bench_tool.cc +++ b/cache/cache_bench_tool.cc @@ -77,11 +77,9 @@ DEFINE_bool(lean, false, "If true, no additional computation is performed besides cache " "operations."); -#ifndef ROCKSDB_LITE DEFINE_string(secondary_cache_uri, "", "Full URI for creating a custom secondary cache object"); static class std::shared_ptr secondary_cache; -#endif // ROCKSDB_LITE DEFINE_string(cache_type, "lru_cache", "Type of block cache."); @@ -305,7 +303,6 @@ class CacheBench { LRUCacheOptions opts(FLAGS_cache_size, FLAGS_num_shard_bits, false /* strict_capacity_limit */, 0.5 /* high_pri_pool_ratio */); -#ifndef ROCKSDB_LITE if (!FLAGS_secondary_cache_uri.empty()) { Status s = SecondaryCache::CreateFromString( ConfigOptions(), FLAGS_secondary_cache_uri, &secondary_cache); @@ -318,7 +315,6 @@ class CacheBench { } opts.secondary_cache = secondary_cache; } -#endif // ROCKSDB_LITE cache_ = NewLRUCache(opts); } else { diff --git a/cache/compressed_secondary_cache_test.cc b/cache/compressed_secondary_cache_test.cc index c13b8b390fb..6a0eae9a3f6 100644 --- a/cache/compressed_secondary_cache_test.cc +++ b/cache/compressed_secondary_cache_test.cc @@ -817,7 +817,6 @@ class CompressedSecondaryCacheTestWithCompressionParam bool sec_cache_is_compressed_; }; -#ifndef ROCKSDB_LITE TEST_P(CompressedSecondaryCacheTestWithCompressionParam, BasicTestFromString) { std::shared_ptr sec_cache{nullptr}; @@ -882,7 +881,6 @@ TEST_P(CompressedSecondaryCacheTestWithCompressionParam, BasicTestHelper(sec_cache, sec_cache_is_compressed_); } -#endif // ROCKSDB_LITE TEST_P(CompressedSecondaryCacheTestWithCompressionParam, FailsTest) { FailsTest(sec_cache_is_compressed_); diff --git a/cache/lru_cache_test.cc b/cache/lru_cache_test.cc index ee2f6baa383..3ea67e40bd0 100644 --- a/cache/lru_cache_test.cc +++ b/cache/lru_cache_test.cc @@ -1975,7 +1975,6 @@ class LRUCacheWithStat : public LRUCache { uint32_t lookup_count_; }; -#ifndef ROCKSDB_LITE TEST_F(DBSecondaryCacheTest, LRUCacheDumpLoadBasic) { LRUCacheOptions cache_opts(1024 * 1024 /* capacity */, 0 /* num_shard_bits */, @@ -2590,7 +2589,6 @@ TEST_F(DBSecondaryCacheTest, TestSecondaryCacheOptionTwoDB) { ASSERT_OK(DestroyDB(dbname2, options)); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/blob/blob_file_completion_callback.h b/db/blob/blob_file_completion_callback.h index ffe65a0ffa2..91596773155 100644 --- a/db/blob/blob_file_completion_callback.h +++ b/db/blob/blob_file_completion_callback.h @@ -23,32 +23,19 @@ class BlobFileCompletionCallback { const std::vector>& listeners, const std::string& dbname) : event_logger_(event_logger), listeners_(listeners), dbname_(dbname) { -#ifndef ROCKSDB_LITE sst_file_manager_ = sst_file_manager; mutex_ = mutex; error_handler_ = error_handler; -#else - (void)sst_file_manager; - (void)mutex; - (void)error_handler; -#endif // ROCKSDB_LITE } void OnBlobFileCreationStarted(const std::string& file_name, const std::string& column_family_name, int job_id, BlobFileCreationReason creation_reason) { -#ifndef ROCKSDB_LITE // Notify the listeners. EventHelpers::NotifyBlobFileCreationStarted(listeners_, dbname_, column_family_name, file_name, job_id, creation_reason); -#else - (void)file_name; - (void)column_family_name; - (void)job_id; - (void)creation_reason; -#endif } Status OnBlobFileCompleted(const std::string& file_name, @@ -61,7 +48,6 @@ class BlobFileCompletionCallback { uint64_t blob_count, uint64_t blob_bytes) { Status s; -#ifndef ROCKSDB_LITE auto sfm = static_cast(sst_file_manager_); if (sfm) { // Report new blob files to SstFileManagerImpl @@ -74,7 +60,6 @@ class BlobFileCompletionCallback { error_handler_->SetBGError(s, BackgroundErrorReason::kFlush); } } -#endif // !ROCKSDB_LITE // Notify the listeners. EventHelpers::LogAndNotifyBlobFileCreationFinished( @@ -89,11 +74,9 @@ class BlobFileCompletionCallback { } private: -#ifndef ROCKSDB_LITE SstFileManager* sst_file_manager_; InstrumentedMutex* mutex_; ErrorHandler* error_handler_; -#endif // ROCKSDB_LITE EventLogger* event_logger_; std::vector> listeners_; std::string dbname_; diff --git a/db/blob/blob_source.cc b/db/blob/blob_source.cc index 19cfb1f89a1..9634435007f 100644 --- a/db/blob/blob_source.cc +++ b/db/blob/blob_source.cc @@ -30,7 +30,6 @@ BlobSource::BlobSource(const ImmutableOptions* immutable_options, blob_file_cache_(blob_file_cache), blob_cache_(immutable_options->blob_cache), lowest_used_cache_tier_(immutable_options->lowest_used_cache_tier) { -#ifndef ROCKSDB_LITE auto bbto = immutable_options->table_factory->GetOptions(); if (bbto && @@ -39,7 +38,6 @@ BlobSource::BlobSource(const ImmutableOptions* immutable_options, blob_cache_ = SharedCacheInterface{std::make_shared( immutable_options->blob_cache, bbto->block_cache)}; } -#endif // ROCKSDB_LITE } BlobSource::~BlobSource() = default; diff --git a/db/blob/blob_source_test.cc b/db/blob/blob_source_test.cc index 4a1ba84eeab..6fd8392795e 100644 --- a/db/blob/blob_source_test.cc +++ b/db/blob/blob_source_test.cc @@ -1391,7 +1391,6 @@ class BlobSourceCacheReservationTest : public DBTestBase { std::string db_session_id_; }; -#ifndef ROCKSDB_LITE TEST_F(BlobSourceCacheReservationTest, SimpleCacheReservation) { options_.cf_paths.emplace_back( test::PerThreadDBPath( @@ -1606,7 +1605,6 @@ TEST_F(BlobSourceCacheReservationTest, IncreaseCacheReservationOnFullCache) { } } } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/blob/db_blob_basic_test.cc b/db/blob/db_blob_basic_test.cc index e6832a2ae44..255e4552e1a 100644 --- a/db/blob/db_blob_basic_test.cc +++ b/db/blob/db_blob_basic_test.cc @@ -584,7 +584,6 @@ TEST_F(DBBlobBasicTest, MultiGetBlobsFromCache) { } } -#ifndef ROCKSDB_LITE TEST_F(DBBlobBasicTest, MultiGetWithDirectIO) { Options options = GetDefaultOptions(); @@ -773,7 +772,6 @@ TEST_F(DBBlobBasicTest, MultiGetWithDirectIO) { ASSERT_EQ(values[2], second_blob); } } -#endif // !ROCKSDB_LITE TEST_F(DBBlobBasicTest, MultiGetBlobsFromMultipleFiles) { Options options = GetDefaultOptions(); @@ -1062,7 +1060,6 @@ TEST_F(DBBlobBasicTest, GetBlob_IndexWithInvalidFileNumber) { .IsCorruption()); } -#ifndef ROCKSDB_LITE TEST_F(DBBlobBasicTest, GenerateIOTracing) { Options options = GetDefaultOptions(); options.enable_blob_files = true; @@ -1117,7 +1114,6 @@ TEST_F(DBBlobBasicTest, GenerateIOTracing) { ASSERT_GT(blob_files_op_count, 2); } } -#endif // !ROCKSDB_LITE TEST_F(DBBlobBasicTest, BestEffortsRecovery_MissingNewestBlobFile) { Options options = GetDefaultOptions(); @@ -1219,7 +1215,6 @@ TEST_F(DBBlobBasicTest, MultiGetMergeBlobWithPut) { ASSERT_EQ(values[2], "v2_0"); } -#ifndef ROCKSDB_LITE TEST_F(DBBlobBasicTest, Properties) { Options options = GetDefaultOptions(); options.enable_blob_files = true; @@ -1382,7 +1377,6 @@ TEST_F(DBBlobBasicTest, PropertiesMultiVersion) { BlobLogRecord::CalculateAdjustmentForRecordHeader(key_size) + blob_size + BlobLogFooter::kSize)); } -#endif // !ROCKSDB_LITE class DBBlobBasicIOErrorTest : public DBBlobBasicTest, public testing::WithParamInterface { @@ -1632,7 +1626,6 @@ TEST_F(DBBlobBasicTest, WarmCacheWithBlobsDuringFlush) { options.statistics->getTickerCount(BLOB_DB_CACHE_ADD)); } -#ifndef ROCKSDB_LITE TEST_F(DBBlobBasicTest, DynamicallyWarmCacheDuringFlush) { Options options = GetDefaultOptions(); @@ -1700,7 +1693,6 @@ TEST_F(DBBlobBasicTest, DynamicallyWarmCacheDuringFlush) { /*end=*/nullptr)); EXPECT_EQ(0, options.statistics->getTickerCount(BLOB_DB_CACHE_ADD)); } -#endif // !ROCKSDB_LITE TEST_F(DBBlobBasicTest, WarmCacheWithBlobsSecondary) { CompressedSecondaryCacheOptions secondary_cache_opts; diff --git a/db/blob/db_blob_compaction_test.cc b/db/blob/db_blob_compaction_test.cc index f3fe3c03bc3..14a3155e251 100644 --- a/db/blob/db_blob_compaction_test.cc +++ b/db/blob/db_blob_compaction_test.cc @@ -16,7 +16,6 @@ class DBBlobCompactionTest : public DBTestBase { explicit DBBlobCompactionTest() : DBTestBase("db_blob_compaction_test", /*env_do_fsync=*/false) {} -#ifndef ROCKSDB_LITE const std::vector& GetCompactionStats() { VersionSet* const versions = dbfull()->GetVersionSet(); assert(versions); @@ -30,7 +29,6 @@ class DBBlobCompactionTest : public DBTestBase { return internal_stats->TEST_GetCompactionStats(); } -#endif // ROCKSDB_LITE }; namespace { @@ -250,7 +248,6 @@ TEST_F(DBBlobCompactionTest, FilterByKeyLength) { ASSERT_OK(db_->Get(ReadOptions(), long_key, &value)); ASSERT_EQ("value", value); -#ifndef ROCKSDB_LITE const auto& compaction_stats = GetCompactionStats(); ASSERT_GE(compaction_stats.size(), 2); @@ -258,7 +255,6 @@ TEST_F(DBBlobCompactionTest, FilterByKeyLength) { // this involves neither reading nor writing blobs ASSERT_EQ(compaction_stats[1].bytes_read_blob, 0); ASSERT_EQ(compaction_stats[1].bytes_written_blob, 0); -#endif // ROCKSDB_LITE Close(); } @@ -299,7 +295,6 @@ TEST_F(DBBlobCompactionTest, FilterByValueLength) { ASSERT_EQ(long_value, value); } -#ifndef ROCKSDB_LITE const auto& compaction_stats = GetCompactionStats(); ASSERT_GE(compaction_stats.size(), 2); @@ -307,12 +302,10 @@ TEST_F(DBBlobCompactionTest, FilterByValueLength) { // this involves reading but not writing blobs ASSERT_GT(compaction_stats[1].bytes_read_blob, 0); ASSERT_EQ(compaction_stats[1].bytes_written_blob, 0); -#endif // ROCKSDB_LITE Close(); } -#ifndef ROCKSDB_LITE TEST_F(DBBlobCompactionTest, BlobCompactWithStartingLevel) { Options options = GetDefaultOptions(); @@ -388,7 +381,6 @@ TEST_F(DBBlobCompactionTest, BlobCompactWithStartingLevel) { Close(); } -#endif TEST_F(DBBlobCompactionTest, BlindWriteFilter) { Options options = GetDefaultOptions(); @@ -413,7 +405,6 @@ TEST_F(DBBlobCompactionTest, BlindWriteFilter) { ASSERT_EQ(new_blob_value, Get(key)); } -#ifndef ROCKSDB_LITE const auto& compaction_stats = GetCompactionStats(); ASSERT_GE(compaction_stats.size(), 2); @@ -421,7 +412,6 @@ TEST_F(DBBlobCompactionTest, BlindWriteFilter) { // this involves writing but not reading blobs ASSERT_EQ(compaction_stats[1].bytes_read_blob, 0); ASSERT_GT(compaction_stats[1].bytes_written_blob, 0); -#endif // ROCKSDB_LITE Close(); } @@ -540,7 +530,6 @@ TEST_F(DBBlobCompactionTest, CompactionFilter) { ASSERT_EQ(kv.second + std::string(padding), Get(kv.first)); } -#ifndef ROCKSDB_LITE const auto& compaction_stats = GetCompactionStats(); ASSERT_GE(compaction_stats.size(), 2); @@ -548,7 +537,6 @@ TEST_F(DBBlobCompactionTest, CompactionFilter) { // this involves reading and writing blobs ASSERT_GT(compaction_stats[1].bytes_read_blob, 0); ASSERT_GT(compaction_stats[1].bytes_written_blob, 0); -#endif // ROCKSDB_LITE Close(); } @@ -606,7 +594,6 @@ TEST_F(DBBlobCompactionTest, CompactionFilterReadBlobAndKeep) { /*end=*/nullptr)); ASSERT_EQ(blob_files, GetBlobFileNumbers()); -#ifndef ROCKSDB_LITE const auto& compaction_stats = GetCompactionStats(); ASSERT_GE(compaction_stats.size(), 2); @@ -614,7 +601,6 @@ TEST_F(DBBlobCompactionTest, CompactionFilterReadBlobAndKeep) { // this involves reading but not writing blobs ASSERT_GT(compaction_stats[1].bytes_read_blob, 0); ASSERT_EQ(compaction_stats[1].bytes_written_blob, 0); -#endif // ROCKSDB_LITE Close(); } diff --git a/db/blob/db_blob_corruption_test.cc b/db/blob/db_blob_corruption_test.cc index 7ac7ce3fc70..694b25b2eca 100644 --- a/db/blob/db_blob_corruption_test.cc +++ b/db/blob/db_blob_corruption_test.cc @@ -34,7 +34,6 @@ class DBBlobCorruptionTest : public DBTestBase { } }; -#ifndef ROCKSDB_LITE TEST_F(DBBlobCorruptionTest, VerifyWholeBlobFileChecksum) { Options options = GetDefaultOptions(); options.enable_blob_files = true; @@ -71,7 +70,6 @@ TEST_F(DBBlobCorruptionTest, VerifyWholeBlobFileChecksum) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/db/blob/db_blob_index_test.cc b/db/blob/db_blob_index_test.cc index 64c55089412..eabca13589d 100644 --- a/db/blob/db_blob_index_test.cc +++ b/db/blob/db_blob_index_test.cc @@ -131,9 +131,7 @@ class DBBlobIndexTest : public DBTestBase { ASSERT_OK(Flush()); ASSERT_OK( dbfull()->CompactRange(CompactRangeOptions(), nullptr, nullptr)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,1", FilesPerLevel()); -#endif // !ROCKSDB_LITE break; } } @@ -459,7 +457,6 @@ TEST_F(DBBlobIndexTest, Iterate) { verify(15, Status::kOk, get_value(16, 0), get_value(14, 0), create_blob_iterator, check_is_blob(false)); -#ifndef ROCKSDB_LITE // Iterator with blob support and using seek. ASSERT_OK(dbfull()->SetOptions( cfh(), {{"max_sequential_skip_in_iterations", "0"}})); @@ -484,7 +481,6 @@ TEST_F(DBBlobIndexTest, Iterate) { create_blob_iterator, check_is_blob(false)); verify(15, Status::kOk, get_value(16, 0), get_value(14, 0), create_blob_iterator, check_is_blob(false)); -#endif // !ROCKSDB_LITE for (auto* snapshot : snapshots) { dbfull()->ReleaseSnapshot(snapshot); @@ -584,12 +580,10 @@ TEST_F(DBBlobIndexTest, IntegratedBlobIterate) { Status expected_status; verify(1, expected_status, expected_value); -#ifndef ROCKSDB_LITE // Test DBIter::FindValueForCurrentKeyUsingSeek flow. ASSERT_OK(dbfull()->SetOptions(cfh(), {{"max_sequential_skip_in_iterations", "0"}})); verify(1, expected_status, expected_value); -#endif // !ROCKSDB_LITE } } // namespace ROCKSDB_NAMESPACE diff --git a/db/builder.cc b/db/builder.cc index a84bd5a45f4..b86dd6b9ce5 100644 --- a/db/builder.cc +++ b/db/builder.cc @@ -107,11 +107,9 @@ Status BuildTable( std::vector blob_file_paths; std::string file_checksum = kUnknownFileChecksum; std::string file_checksum_func_name = kUnknownFileChecksumFuncName; -#ifndef ROCKSDB_LITE EventHelpers::NotifyTableFileCreationStarted(ioptions.listeners, dbname, tboptions.column_family_name, fname, job_id, tboptions.reason); -#endif // !ROCKSDB_LITE Env* env = db_options.env; assert(env); FileSystem* fs = db_options.fs.get(); diff --git a/db/c.cc b/db/c.cc index 2ba17c69093..ef5fe8c5439 100644 --- a/db/c.cc +++ b/db/c.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "rocksdb/c.h" @@ -6399,4 +6398,3 @@ void rocksdb_enable_manual_compaction(rocksdb_t* db) { } // end extern "C" -#endif // !ROCKSDB_LITE diff --git a/db/c_test.c b/db/c_test.c index b6877d46a99..415f30d3612 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -5,8 +5,6 @@ #include -#ifndef ROCKSDB_LITE // Lite does not support C API - #include #include #include @@ -3468,12 +3466,3 @@ int main(int argc, char** argv) { fprintf(stderr, "PASS\n"); return 0; } - -#else - -int main(void) { - fprintf(stderr, "SKIPPED\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/column_family.cc b/db/column_family.cc index 3a1d22c3df0..a17ab665aa4 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -53,11 +53,9 @@ ColumnFamilyHandleImpl::ColumnFamilyHandleImpl( ColumnFamilyHandleImpl::~ColumnFamilyHandleImpl() { if (cfd_ != nullptr) { -#ifndef ROCKSDB_LITE for (auto& listener : cfd_->ioptions()->listeners) { listener->OnColumnFamilyHandleDeletionStarted(this); } -#endif // ROCKSDB_LITE // Job id == 0 means that this is not our background process, but rather // user thread // Need to hold some shared pointers owned by the initial_cf_options @@ -88,15 +86,10 @@ const std::string& ColumnFamilyHandleImpl::GetName() const { } Status ColumnFamilyHandleImpl::GetDescriptor(ColumnFamilyDescriptor* desc) { -#ifndef ROCKSDB_LITE // accessing mutable cf-options requires db mutex. InstrumentedMutexLock l(mutex_); *desc = ColumnFamilyDescriptor(cfd()->GetName(), cfd()->GetLatestCFOptions()); return Status::OK(); -#else - (void)desc; - return Status::NotSupported(); -#endif // !ROCKSDB_LITE } const Comparator* ColumnFamilyHandleImpl::GetComparator() const { @@ -347,7 +340,6 @@ ColumnFamilyOptions SanitizeOptions(const ImmutableDBOptions& db_options, result.hard_pending_compaction_bytes_limit; } -#ifndef ROCKSDB_LITE // When the DB is stopped, it's possible that there are some .trash files that // were not deleted yet, when we open the DB we will find these .trash files // and schedule them to be deleted (or delete immediately if SstFileManager @@ -359,7 +351,6 @@ ColumnFamilyOptions SanitizeOptions(const ImmutableDBOptions& db_options, result.cf_paths[i].path) .PermitUncheckedError(); } -#endif if (result.cf_paths.empty()) { result.cf_paths = db_options.db_paths; @@ -602,7 +593,6 @@ ColumnFamilyData::ColumnFamilyData( if (ioptions_.compaction_style == kCompactionStyleLevel) { compaction_picker_.reset( new LevelCompactionPicker(ioptions_, &internal_comparator_)); -#ifndef ROCKSDB_LITE } else if (ioptions_.compaction_style == kCompactionStyleUniversal) { compaction_picker_.reset( new UniversalCompactionPicker(ioptions_, &internal_comparator_)); @@ -616,7 +606,6 @@ ColumnFamilyData::ColumnFamilyData( "Column family %s does not use any background compaction. " "Compactions can only be done via CompactFiles\n", GetName().c_str()); -#endif // !ROCKSDB_LITE } else { ROCKS_LOG_ERROR(ioptions_.logger, "Unable to recognize the specified compaction style %d. " @@ -1440,7 +1429,6 @@ Status ColumnFamilyData::ValidateOptions( return s; } -#ifndef ROCKSDB_LITE Status ColumnFamilyData::SetOptions( const DBOptions& db_opts, const std::unordered_map& options_map) { @@ -1459,7 +1447,6 @@ Status ColumnFamilyData::SetOptions( } return s; } -#endif // ROCKSDB_LITE // REQUIRES: DB mutex held Env::WriteLifeTimeHint ColumnFamilyData::CalculateSSTWriteHint(int level) { diff --git a/db/column_family.h b/db/column_family.h index 0c696ed4e2b..44c04cc9aa5 100644 --- a/db/column_family.h +++ b/db/column_family.h @@ -335,12 +335,10 @@ class ColumnFamilyData { // Validate CF options against DB options static Status ValidateOptions(const DBOptions& db_options, const ColumnFamilyOptions& cf_options); -#ifndef ROCKSDB_LITE // REQUIRES: DB mutex held Status SetOptions( const DBOptions& db_options, const std::unordered_map& options_map); -#endif // ROCKSDB_LITE InternalStats* internal_stats() { return internal_stats_.get(); } diff --git a/db/column_family_test.cc b/db/column_family_test.cc index d33cbe50a77..9c92707d34a 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -71,11 +71,7 @@ class ColumnFamilyTestBase : public testing::Test { for (auto h : handles_) { ColumnFamilyDescriptor cfdescriptor; Status s = h->GetDescriptor(&cfdescriptor); -#ifdef ROCKSDB_LITE - EXPECT_TRUE(s.IsNotSupported()); -#else EXPECT_OK(s); -#endif // ROCKSDB_LITE column_families.push_back(cfdescriptor); } ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); @@ -197,12 +193,10 @@ class ColumnFamilyTestBase : public testing::Test { &db_); } -#ifndef ROCKSDB_LITE // ReadOnlyDB is not supported void AssertOpenReadOnly(std::vector cf, std::vector options = {}) { ASSERT_OK(OpenReadOnly(cf, options)); } -#endif // !ROCKSDB_LITE void Open(std::vector cf, std::vector options = {}) { @@ -224,27 +218,16 @@ class ColumnFamilyTestBase : public testing::Test { } bool IsDbWriteStopped() { -#ifndef ROCKSDB_LITE uint64_t v; EXPECT_TRUE(dbfull()->GetIntProperty("rocksdb.is-write-stopped", &v)); return (v == 1); -#else - return dbfull()->TEST_write_controler().IsStopped(); -#endif // !ROCKSDB_LITE } uint64_t GetDbDelayedWriteRate() { -#ifndef ROCKSDB_LITE uint64_t v; EXPECT_TRUE( dbfull()->GetIntProperty("rocksdb.actual-delayed-write-rate", &v)); return v; -#else - if (!dbfull()->TEST_write_controler().NeedsDelay()) { - return 0; - } - return dbfull()->TEST_write_controler().delayed_write_rate(); -#endif // !ROCKSDB_LITE } void Destroy(const std::vector& column_families = @@ -267,7 +250,6 @@ class ColumnFamilyTestBase : public testing::Test { db_->CreateColumnFamily(current_cf_opt, cfs[i], &handles_[cfi])); names_[cfi] = cfs[i]; -#ifndef ROCKSDB_LITE // RocksDBLite does not support GetDescriptor // Verify the CF options of the returned CF handle. ColumnFamilyDescriptor desc; ASSERT_OK(handles_[cfi]->GetDescriptor(&desc)); @@ -276,7 +258,6 @@ class ColumnFamilyTestBase : public testing::Test { ASSERT_OK(RocksDBOptionsParser::VerifyCFOptions( ConfigOptions(), desc.options, SanitizeOptions(dbfull()->immutable_db_options(), current_cf_opt))); -#endif // !ROCKSDB_LITE cfi++; } } @@ -325,7 +306,6 @@ class ColumnFamilyTestBase : public testing::Test { ASSERT_OK(db_->FlushWAL(/*sync=*/false)); } -#ifndef ROCKSDB_LITE // TEST functions in DB are not supported in lite void WaitForFlush(int cf) { ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable(handles_[cf])); } @@ -339,7 +319,6 @@ class ColumnFamilyTestBase : public testing::Test { void AssertMaxTotalInMemoryState(uint64_t value) { ASSERT_EQ(value, MaxTotalInMemoryState()); } -#endif // !ROCKSDB_LITE Status Put(int cf, const std::string& key, const std::string& value) { return db_->Put(WriteOptions(), handles_[cf], Slice(key), Slice(value)); @@ -377,7 +356,6 @@ class ColumnFamilyTestBase : public testing::Test { "rocksdb.num-files-at-level" + std::to_string(level)); } -#ifndef ROCKSDB_LITE // Return spread of files per level std::string FilesPerLevel(int cf) { std::string result; @@ -394,31 +372,19 @@ class ColumnFamilyTestBase : public testing::Test { result.resize(last_non_zero_offset); return result; } -#endif void AssertFilesPerLevel(const std::string& value, int cf) { -#ifndef ROCKSDB_LITE ASSERT_EQ(value, FilesPerLevel(cf)); -#else - (void)value; - (void)cf; -#endif } -#ifndef ROCKSDB_LITE // GetLiveFilesMetaData is not supported int CountLiveFiles() { std::vector metadata; db_->GetLiveFilesMetaData(&metadata); return static_cast(metadata.size()); } -#endif // !ROCKSDB_LITE void AssertCountLiveFiles(int expected_value) { -#ifndef ROCKSDB_LITE ASSERT_EQ(expected_value, CountLiveFiles()); -#else - (void)expected_value; -#endif } // Do n memtable flushes, each of which produces an sstable @@ -432,7 +398,6 @@ class ColumnFamilyTestBase : public testing::Test { } } -#ifndef ROCKSDB_LITE // GetSortedWalFiles is not supported int CountLiveLogFiles() { int micros_wait_for_log_deletion = 20000; env_->SleepForMicroseconds(micros_wait_for_log_deletion); @@ -461,25 +426,18 @@ class ColumnFamilyTestBase : public testing::Test { return ret; return 0; } -#endif // !ROCKSDB_LITE void AssertCountLiveLogFiles(int value) { -#ifndef ROCKSDB_LITE // GetSortedWalFiles is not supported ASSERT_EQ(value, CountLiveLogFiles()); -#else - (void)value; -#endif // !ROCKSDB_LITE } void AssertNumberOfImmutableMemtables(std::vector num_per_cf) { assert(num_per_cf.size() == handles_.size()); -#ifndef ROCKSDB_LITE // GetProperty is not supported in lite for (size_t i = 0; i < num_per_cf.size(); ++i) { ASSERT_EQ(num_per_cf[i], GetProperty(static_cast(i), "rocksdb.num-immutable-mem-table")); } -#endif // !ROCKSDB_LITE } void CopyFile(const std::string& source, const std::string& destination, @@ -575,7 +533,6 @@ TEST_P(ColumnFamilyTest, DontReuseColumnFamilyID) { } } -#ifndef ROCKSDB_LITE TEST_P(ColumnFamilyTest, CreateCFRaceWithGetAggProperty) { Open(); @@ -598,7 +555,6 @@ TEST_P(ColumnFamilyTest, CreateCFRaceWithGetAggProperty) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#endif // !ROCKSDB_LITE class FlushEmptyCFTestWithParam : public ColumnFamilyTestBase, @@ -942,7 +898,6 @@ TEST_P(ColumnFamilyTest, IgnoreRecoveredLog) { } } -#ifndef ROCKSDB_LITE // TEST functions used are not supported TEST_P(ColumnFamilyTest, FlushTest) { Open(); CreateColumnFamiliesAndReopen({"one", "two"}); @@ -1057,7 +1012,6 @@ TEST_P(ColumnFamilyTest, LogDeletionTest) { AssertCountLiveLogFiles(4); Close(); } -#endif // !ROCKSDB_LITE TEST_P(ColumnFamilyTest, CrashAfterFlush) { std::unique_ptr fault_env( @@ -1097,7 +1051,6 @@ TEST_P(ColumnFamilyTest, OpenNonexistentColumnFamily) { ASSERT_TRUE(TryOpen({"default", "dne"}).IsInvalidArgument()); } -#ifndef ROCKSDB_LITE // WaitForFlush() is not supported // Makes sure that obsolete log files get deleted TEST_P(ColumnFamilyTest, DifferentWriteBufferSizes) { // disable flushing stale column families @@ -1205,14 +1158,12 @@ TEST_P(ColumnFamilyTest, DifferentWriteBufferSizes) { AssertCountLiveLogFiles(7); Close(); } -#endif // !ROCKSDB_LITE // The test is commented out because we want to test that snapshot is // not created for memtables not supported it, but There isn't a memtable // that doesn't support snapshot right now. If we have one later, we can // re-enable the test. // -// #ifndef ROCKSDB_LITE // Cuckoo is not supported in lite // TEST_P(ColumnFamilyTest, MemtableNotSupportSnapshot) { // db_options_.allow_concurrent_memtable_write = false; // Open(); @@ -1232,7 +1183,6 @@ TEST_P(ColumnFamilyTest, DifferentWriteBufferSizes) { // {second}); auto* s3 = dbfull()->GetSnapshot(); ASSERT_TRUE(s3 == nullptr); // Close(); // } -// #endif // !ROCKSDB_LITE class TestComparator : public Comparator { int Compare(const ROCKSDB_NAMESPACE::Slice& /*a*/, @@ -1299,7 +1249,6 @@ TEST_P(ColumnFamilyTest, DifferentMergeOperators) { Close(); } -#ifndef ROCKSDB_LITE // WaitForFlush() is not supported TEST_P(ColumnFamilyTest, DifferentCompactionStyles) { Open(); CreateColumnFamilies({"one", "two"}); @@ -1367,9 +1316,7 @@ TEST_P(ColumnFamilyTest, DifferentCompactionStyles) { Close(); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // Sync points not supported in RocksDB Lite TEST_P(ColumnFamilyTest, MultipleManualCompactions) { @@ -2033,9 +1980,7 @@ TEST_P(ColumnFamilyTest, SameCFAutomaticManualCompactions) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // Tailing iterator not supported namespace { std::string IterStatus(Iterator* iter) { std::string result; @@ -2093,9 +2038,7 @@ TEST_P(ColumnFamilyTest, NewIteratorsTest) { Destroy(); } } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // ReadOnlyDB is not supported TEST_P(ColumnFamilyTest, ReadOnlyDBTest) { Open(); CreateColumnFamiliesAndReopen({"one", "two", "three", "four"}); @@ -2144,9 +2087,7 @@ TEST_P(ColumnFamilyTest, ReadOnlyDBTest) { s = OpenReadOnly({"one", "four"}); ASSERT_TRUE(!s.ok()); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // WaitForFlush() is not supported in lite TEST_P(ColumnFamilyTest, DontRollEmptyLogs) { Open(); CreateColumnFamiliesAndReopen({"one", "two", "three", "four"}); @@ -2168,9 +2109,7 @@ TEST_P(ColumnFamilyTest, DontRollEmptyLogs) { ASSERT_EQ(static_cast(total_new_writable_files), handles_.size() + 1); Close(); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // WaitForCompaction() is not supported in lite TEST_P(ColumnFamilyTest, FlushStaleColumnFamilies) { Open(); CreateColumnFamilies({"one", "two"}); @@ -2217,7 +2156,6 @@ TEST_P(ColumnFamilyTest, FlushStaleColumnFamilies) { ASSERT_EQ(0, dbfull()->TEST_total_log_size()); Close(); } -#endif // !ROCKSDB_LITE TEST_P(ColumnFamilyTest, CreateMissingColumnFamilies) { Status s = TryOpen({"one", "two"}); @@ -2457,8 +2395,6 @@ TEST_P(ColumnFamilyTest, FlushAndDropRaceCondition) { Destroy(); } -#ifndef ROCKSDB_LITE -// skipped as persisting options is not supported in ROCKSDB_LITE namespace { std::atomic test_stage(0); std::atomic ordered_by_writethread(false); @@ -2540,7 +2476,6 @@ TEST_P(ColumnFamilyTest, CreateAndDropRace) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); } -#endif // !ROCKSDB_LITE TEST_P(ColumnFamilyTest, WriteStallSingleColumnFamily) { const uint64_t kBaseRate = 800000u; @@ -2950,7 +2885,6 @@ TEST_P(ColumnFamilyTest, CreateDropAndDestroy) { ASSERT_OK(db_->DestroyColumnFamilyHandle(cfh)); } -#ifndef ROCKSDB_LITE TEST_P(ColumnFamilyTest, CreateDropAndDestroyWithoutFileDeletion) { ColumnFamilyHandle* cfh; Open(); @@ -3005,9 +2939,7 @@ TEST_P(ColumnFamilyTest, FlushCloseWALFiles) { db_options_.env = env_; Close(); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // WaitForFlush() is not supported TEST_P(ColumnFamilyTest, IteratorCloseWALFile1) { SpecialEnv env(Env::Default()); db_options_.env = &env; @@ -3114,9 +3046,7 @@ TEST_P(ColumnFamilyTest, IteratorCloseWALFile2) { db_options_.env = env_; Close(); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // TEST functions are not supported in lite TEST_P(ColumnFamilyTest, ForwardIteratorCloseWALFile) { SpecialEnv env(Env::Default()); // Allow both of flush and purge job to schedule. @@ -3192,7 +3122,6 @@ TEST_P(ColumnFamilyTest, ForwardIteratorCloseWALFile) { db_options_.env = env_; Close(); } -#endif // !ROCKSDB_LITE // Disable on windows because SyncWAL requires env->IsSyncThreadSafe() // to return true which is not so in unbuffered mode. diff --git a/db/compact_files_test.cc b/db/compact_files_test.cc index ef38946f7e2..ad94ad340dd 100644 --- a/db/compact_files_test.cc +++ b/db/compact_files_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include #include @@ -490,13 +489,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as DBImpl::CompactFiles is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/compaction/compaction_job.cc b/db/compaction/compaction_job.cc index 302023d65da..bd575966e67 100644 --- a/db/compaction/compaction_job.cc +++ b/db/compaction/compaction_job.cc @@ -978,7 +978,6 @@ Status CompactionJob::Install(const MutableCFOptions& mutable_cf_options) { void CompactionJob::NotifyOnSubcompactionBegin( SubcompactionState* sub_compact) { -#ifndef ROCKSDB_LITE Compaction* c = compact_->compaction; if (db_options_.listeners.empty()) { @@ -1004,14 +1003,10 @@ void CompactionJob::NotifyOnSubcompactionBegin( } info.status.PermitUncheckedError(); -#else - (void)sub_compact; -#endif // ROCKSDB_LITE } void CompactionJob::NotifyOnSubcompactionCompleted( SubcompactionState* sub_compact) { -#ifndef ROCKSDB_LITE if (db_options_.listeners.empty()) { return; @@ -1032,16 +1027,12 @@ void CompactionJob::NotifyOnSubcompactionCompleted( for (const auto& listener : db_options_.listeners) { listener->OnSubcompactionCompleted(info); } -#else - (void)sub_compact; -#endif // ROCKSDB_LITE } void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) { assert(sub_compact); assert(sub_compact->compaction); -#ifndef ROCKSDB_LITE if (db_options_.compaction_service) { CompactionServiceJobStatus comp_status = ProcessKeyValueCompactionWithCompactionService(sub_compact); @@ -1052,7 +1043,6 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) { // fallback to local compaction assert(comp_status == CompactionServiceJobStatus::kUseLocal); } -#endif // !ROCKSDB_LITE uint64_t prev_cpu_micros = db_options_.clock->CPUMicros(); @@ -1615,7 +1605,6 @@ Status CompactionJob::FinishCompactionOutputFile( TableFileCreationReason::kCompaction, status_for_listener, file_checksum, file_checksum_func_name); -#ifndef ROCKSDB_LITE // Report new file to SstFileManagerImpl auto sfm = static_cast(db_options_.sst_file_manager.get()); @@ -1634,7 +1623,6 @@ Status CompactionJob::FinishCompactionOutputFile( db_error_handler_->SetBGError(s, BackgroundErrorReason::kCompaction); } } -#endif outputs.ResetBuilder(); return s; @@ -1759,11 +1747,9 @@ Status CompactionJob::OpenCompactionOutputFile(SubcompactionState* sub_compact, std::string fname = GetTableFileName(file_number); // Fire events. ColumnFamilyData* cfd = sub_compact->compaction->column_family_data(); -#ifndef ROCKSDB_LITE EventHelpers::NotifyTableFileCreationStarted( cfd->ioptions()->listeners, dbname_, cfd->GetName(), fname, job_id_, TableFileCreationReason::kCompaction); -#endif // !ROCKSDB_LITE // Make the output file std::unique_ptr writable_file; #ifndef NDEBUG @@ -1900,7 +1886,6 @@ void CompactionJob::CleanupCompaction() { compact_ = nullptr; } -#ifndef ROCKSDB_LITE namespace { void CopyPrefix(const Slice& src, size_t prefix_length, std::string* dst) { assert(prefix_length > 0); @@ -1909,7 +1894,6 @@ void CopyPrefix(const Slice& src, size_t prefix_length, std::string* dst) { } } // namespace -#endif // !ROCKSDB_LITE void CompactionJob::UpdateCompactionStats() { assert(compact_); @@ -1956,7 +1940,6 @@ void CompactionJob::UpdateCompactionInputStatsHelper(int* num_files, void CompactionJob::UpdateCompactionJobStats( const InternalStats::CompactionStats& stats) const { -#ifndef ROCKSDB_LITE compaction_job_stats_->elapsed_micros = stats.micros; // input information @@ -1983,9 +1966,6 @@ void CompactionJob::UpdateCompactionJobStats( CopyPrefix(compact_->LargestUserKey(), CompactionJobStats::kMaxPrefixLength, &compaction_job_stats_->largest_output_key_prefix); } -#else - (void)stats; -#endif // !ROCKSDB_LITE } void CompactionJob::LogCompaction() { diff --git a/db/compaction/compaction_job_stats_test.cc b/db/compaction/compaction_job_stats_test.cc index 9302707780b..9f93f19727a 100644 --- a/db/compaction/compaction_job_stats_test.cc +++ b/db/compaction/compaction_job_stats_test.cc @@ -59,7 +59,6 @@ #include "utilities/merge_operators.h" #if !defined(IOS_CROSS_COMPILE) -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { static std::string RandomString(Random* rnd, int len, double ratio) { @@ -959,15 +958,6 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED, not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE #else diff --git a/db/compaction/compaction_job_test.cc b/db/compaction/compaction_job_test.cc index 0f0c5daf776..578d7067cb5 100644 --- a/db/compaction/compaction_job_test.cc +++ b/db/compaction/compaction_job_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/compaction/compaction_job.h" @@ -2442,13 +2441,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as CompactionJobStats is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/db/compaction/compaction_picker.cc b/db/compaction/compaction_picker.cc index 5fe058b56d1..06a69cb0166 100644 --- a/db/compaction/compaction_picker.cc +++ b/db/compaction/compaction_picker.cc @@ -877,7 +877,6 @@ Compaction* CompactionPicker::CompactRange( return compaction; } -#ifndef ROCKSDB_LITE namespace { // Test whether two files have overlapping key-ranges. bool HaveOverlappingKeyRanges(const Comparator* c, const SstFileMetaData& a, @@ -1116,7 +1115,6 @@ Status CompactionPicker::SanitizeCompactionInputFiles( return Status::OK(); } -#endif // !ROCKSDB_LITE void CompactionPicker::RegisterCompaction(Compaction* c) { if (c == nullptr) { diff --git a/db/compaction/compaction_picker.h b/db/compaction/compaction_picker.h index d98af851bfe..0556e992754 100644 --- a/db/compaction/compaction_picker.h +++ b/db/compaction/compaction_picker.h @@ -93,11 +93,9 @@ class CompactionPicker { // into a valid one by adding more files, the function will return a // non-ok status with specific reason. // -#ifndef ROCKSDB_LITE Status SanitizeCompactionInputFiles(std::unordered_set* input_files, const ColumnFamilyMetaData& cf_meta, const int output_level) const; -#endif // ROCKSDB_LITE // Free up the files that participated in a compaction // @@ -229,11 +227,9 @@ class CompactionPicker { // A helper function to SanitizeCompactionInputFiles() that // sanitizes "input_files" by adding necessary files. -#ifndef ROCKSDB_LITE virtual Status SanitizeCompactionInputFilesForAllLevels( std::unordered_set* input_files, const ColumnFamilyMetaData& cf_meta, const int output_level) const; -#endif // ROCKSDB_LITE // Keeps track of all compactions that are running on Level0. // Protected by DB mutex @@ -246,7 +242,6 @@ class CompactionPicker { const InternalKeyComparator* const icmp_; }; -#ifndef ROCKSDB_LITE // A dummy compaction that never triggers any automatic // compaction. class NullCompactionPicker : public CompactionPicker { @@ -287,7 +282,6 @@ class NullCompactionPicker : public CompactionPicker { return false; } }; -#endif // !ROCKSDB_LITE // Attempts to find an intra L0 compaction conforming to the given parameters. // diff --git a/db/compaction/compaction_picker_fifo.cc b/db/compaction/compaction_picker_fifo.cc index 362e64e16f2..1b01adbfc33 100644 --- a/db/compaction/compaction_picker_fifo.cc +++ b/db/compaction/compaction_picker_fifo.cc @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "db/compaction/compaction_picker_fifo.h" -#ifndef ROCKSDB_LITE #include #include @@ -443,4 +442,3 @@ Compaction* FIFOCompactionPicker::CompactRange( } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/compaction/compaction_picker_fifo.h b/db/compaction/compaction_picker_fifo.h index 1db760185de..23f08fe97e4 100644 --- a/db/compaction/compaction_picker_fifo.h +++ b/db/compaction/compaction_picker_fifo.h @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #pragma once -#ifndef ROCKSDB_LITE #include "db/compaction/compaction_picker.h" @@ -60,4 +59,3 @@ class FIFOCompactionPicker : public CompactionPicker { LogBuffer* log_buffer); }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/compaction/compaction_picker_test.cc b/db/compaction/compaction_picker_test.cc index 865518cb200..77fde161acf 100644 --- a/db/compaction/compaction_picker_test.cc +++ b/db/compaction/compaction_picker_test.cc @@ -482,8 +482,6 @@ TEST_F(CompactionPickerTest, LevelTriggerDynamic4) { ASSERT_EQ(num_levels - 1, compaction->output_level()); } -// Universal and FIFO Compactions are not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(CompactionPickerTest, NeedsCompactionUniversal) { NewVersionStorage(1, kCompactionStyleUniversal); UniversalCompactionPicker universal_compaction_picker(ioptions_, &icmp_); @@ -1245,7 +1243,6 @@ TEST_F(CompactionPickerTest, FIFOToWarmWithHotBetweenWarms) { ASSERT_EQ(2U, compaction->input(0, 0)->fd.GetNumber()); } -#endif // ROCKSDB_LITE TEST_F(CompactionPickerTest, CompactionPriMinOverlapping1) { NewVersionStorage(6, kCompactionStyleLevel); @@ -2873,7 +2870,6 @@ TEST_F(CompactionPickerTest, IntraL0MaxCompactionBytesHit) { ASSERT_EQ(0, compaction->output_level()); } -#ifndef ROCKSDB_LITE TEST_F(CompactionPickerTest, UniversalMarkedCompactionFullOverlap) { const uint64_t kFileSize = 100000; @@ -3982,7 +3978,6 @@ TEST_P(PerKeyPlacementCompactionPickerTest, INSTANTIATE_TEST_CASE_P(PerKeyPlacementCompactionPickerTest, PerKeyPlacementCompactionPickerTest, ::testing::Bool()); -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/compaction/compaction_picker_universal.cc b/db/compaction/compaction_picker_universal.cc index 3ef4e70b3a6..8ca66df5180 100644 --- a/db/compaction/compaction_picker_universal.cc +++ b/db/compaction/compaction_picker_universal.cc @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "db/compaction/compaction_picker_universal.h" -#ifndef ROCKSDB_LITE #include #include @@ -1451,4 +1450,3 @@ uint64_t UniversalCompactionBuilder::GetMaxOverlappingBytes() const { } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/compaction/compaction_picker_universal.h b/db/compaction/compaction_picker_universal.h index 558733195d8..cb160596929 100644 --- a/db/compaction/compaction_picker_universal.h +++ b/db/compaction/compaction_picker_universal.h @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #pragma once -#ifndef ROCKSDB_LITE #include "db/compaction/compaction_picker.h" @@ -29,4 +28,3 @@ class UniversalCompactionPicker : public CompactionPicker { const VersionStorageInfo* vstorage) const override; }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/compaction/compaction_service_job.cc b/db/compaction/compaction_service_job.cc index 1f6c0b71010..3149bb50025 100644 --- a/db/compaction/compaction_service_job.cc +++ b/db/compaction/compaction_service_job.cc @@ -16,7 +16,6 @@ #include "options/options_helper.h" #include "rocksdb/utilities/options_type.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { class SubcompactionState; @@ -832,4 +831,3 @@ bool CompactionServiceInput::TEST_Equals(CompactionServiceInput* other, #endif // NDEBUG } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/compaction/compaction_service_test.cc b/db/compaction/compaction_service_test.cc index c475c4e3be0..b662ca6e668 100644 --- a/db/compaction/compaction_service_test.cc +++ b/db/compaction/compaction_service_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/db_test_util.h" #include "port/stack_trace.h" @@ -954,13 +953,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as CompactionService is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/db/compaction/sst_partitioner.cc b/db/compaction/sst_partitioner.cc index 9e7f9fa8925..1067191d530 100644 --- a/db/compaction/sst_partitioner.cc +++ b/db/compaction/sst_partitioner.cc @@ -15,11 +15,9 @@ namespace ROCKSDB_NAMESPACE { static std::unordered_map sst_fixed_prefix_type_info = { -#ifndef ROCKSDB_LITE {"length", {0, OptionType::kSizeT, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; SstPartitionerFixedPrefixFactory::SstPartitionerFixedPrefixFactory(size_t len) @@ -58,7 +56,6 @@ std::shared_ptr NewSstPartitionerFixedPrefixFactory( return std::make_shared(prefix_len); } -#ifndef ROCKSDB_LITE namespace { static int RegisterSstPartitionerFactories(ObjectLibrary& library, const std::string& /*arg*/) { @@ -73,17 +70,14 @@ static int RegisterSstPartitionerFactories(ObjectLibrary& library, return 1; } } // namespace -#endif // ROCKSDB_LITE Status SstPartitionerFactory::CreateFromString( const ConfigOptions& options, const std::string& value, std::shared_ptr* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterSstPartitionerFactories(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE return LoadSharedObject(options, value, nullptr, result); } diff --git a/db/compaction/subcompaction_state.h b/db/compaction/subcompaction_state.h index c748be31bb5..83353defcdf 100644 --- a/db/compaction/subcompaction_state.h +++ b/db/compaction/subcompaction_state.h @@ -99,7 +99,6 @@ class SubcompactionState { penultimate_level_outputs_.RemoveLastEmptyOutput(); } -#ifndef ROCKSDB_LITE void BuildSubcompactionJobInfo( SubcompactionJobInfo& subcompaction_job_info) const { const Compaction* c = compaction; @@ -113,7 +112,6 @@ class SubcompactionState { subcompaction_job_info.output_level = c->output_level(); subcompaction_job_info.stats = compaction_job_stats; } -#endif // !ROCKSDB_LITE SubcompactionState() = delete; SubcompactionState(const SubcompactionState&) = delete; diff --git a/db/compaction/tiered_compaction_test.cc b/db/compaction/tiered_compaction_test.cc index f4837dcf9b3..5100570ee50 100644 --- a/db/compaction/tiered_compaction_test.cc +++ b/db/compaction/tiered_compaction_test.cc @@ -17,7 +17,6 @@ namespace ROCKSDB_NAMESPACE { -#if !defined(ROCKSDB_LITE) class TieredCompactionTest : public DBTestBase, public testing::WithParamInterface { @@ -2139,18 +2138,11 @@ TEST_F(PrecludeLastLevelTest, RangeDelsCauseFileEndpointsToOverlap) { Close(); } -#endif // !defined(ROCKSDB_LITE) } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { -#if !defined(ROCKSDB_LITE) ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -#else - (void)argc; - (void)argv; - return 0; -#endif } diff --git a/db/convenience.cc b/db/convenience.cc index 6344d356df3..f18473feb2d 100644 --- a/db/convenience.cc +++ b/db/convenience.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "rocksdb/convenience.h" @@ -78,4 +77,3 @@ Status VerifySstFileChecksum(const Options& options, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/corruption_test.cc b/db/corruption_test.cc index a23cffb4c54..ab506cdb75b 100644 --- a/db/corruption_test.cc +++ b/db/corruption_test.cc @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "rocksdb/options.h" -#ifndef ROCKSDB_LITE #include #include @@ -1668,12 +1667,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as RepairDB() is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/cuckoo_table_db_test.cc b/db/cuckoo_table_db_test.cc index 868b798ea58..7bd4dfda419 100644 --- a/db/cuckoo_table_db_test.cc +++ b/db/cuckoo_table_db_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/db_impl/db_impl.h" #include "db/db_test_util.h" @@ -350,12 +349,3 @@ int main(int argc, char** argv) { } } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as Cuckoo table is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/db/db_basic_test.cc b/db/db_basic_test.cc index 0b734b9921e..d8caefd5993 100644 --- a/db/db_basic_test.cc +++ b/db/db_basic_test.cc @@ -20,9 +20,7 @@ #include "rocksdb/utilities/debug.h" #include "table/block_based/block_based_table_reader.h" #include "table/block_based/block_builder.h" -#if !defined(ROCKSDB_LITE) #include "test_util/sync_point.h" -#endif #include "util/file_checksum_helper.h" #include "util/random.h" #include "utilities/counted_fs.h" @@ -95,7 +93,6 @@ TEST_F(DBBasicTest, UniqueSession) { EXPECT_MATCHES_REGEX(sid2, expected); EXPECT_MATCHES_REGEX(sid3, expected); -#ifndef ROCKSDB_LITE Close(); ASSERT_OK(ReadOnlyReopen(options)); ASSERT_OK(db_->GetDbSessionId(sid1)); @@ -110,7 +107,6 @@ TEST_F(DBBasicTest, UniqueSession) { ASSERT_NE(sid1, sid2); ASSERT_EQ(sid2, sid3); -#endif // ROCKSDB_LITE CreateAndReopenWithCF({"goku"}, options); ASSERT_OK(db_->GetDbSessionId(sid1)); @@ -127,7 +123,6 @@ TEST_F(DBBasicTest, UniqueSession) { ASSERT_NE(sid1, sid4); } -#ifndef ROCKSDB_LITE TEST_F(DBBasicTest, ReadOnlyDB) { ASSERT_OK(Put("foo", "v1")); ASSERT_OK(Put("bar", "v2")); @@ -364,7 +359,6 @@ TEST_F(DBBasicTest, LevelLimitReopen) { options.max_bytes_for_level_multiplier_additional.resize(10, 1); ASSERT_OK(TryReopenWithColumnFamilies({"default", "pikachu"}, options)); } -#endif // ROCKSDB_LITE TEST_F(DBBasicTest, PutDeleteGet) { do { @@ -426,7 +420,6 @@ TEST_F(DBBasicTest, GetFromVersions) { } while (ChangeOptions()); } -#ifndef ROCKSDB_LITE TEST_F(DBBasicTest, GetSnapshot) { anon::OptionsOverride options_override; options_override.skip_policy = kSkipNoSnapshot; @@ -447,7 +440,6 @@ TEST_F(DBBasicTest, GetSnapshot) { } } while (ChangeOptions()); } -#endif // ROCKSDB_LITE TEST_F(DBBasicTest, CheckLock) { do { @@ -700,7 +692,6 @@ TEST_F(DBBasicTest, LockFileRecovery) { } } -#ifndef ROCKSDB_LITE TEST_F(DBBasicTest, Snapshot) { env_->SetMockSleep(); anon::OptionsOverride options_override; @@ -772,7 +763,6 @@ TEST_F(DBBasicTest, Snapshot) { } while (ChangeOptions()); } -#endif // ROCKSDB_LITE class DBBasicMultiConfigs : public DBBasicTest, public ::testing::WithParamInterface { @@ -2729,7 +2719,6 @@ TEST_P(MultiGetPrefixExtractorTest, Batched) { INSTANTIATE_TEST_CASE_P(MultiGetPrefix, MultiGetPrefixExtractorTest, ::testing::Bool()); -#ifndef ROCKSDB_LITE class DBMultiGetRowCacheTest : public DBBasicTest, public ::testing::WithParamInterface {}; @@ -2884,7 +2873,6 @@ TEST_F(DBBasicTest, ValueTypeString) { ASSERT_TRUE(key_version.GetTypeName() != "Invalid"); } } -#endif // !ROCKSDB_LITE TEST_F(DBBasicTest, MultiGetIOBufferOverrun) { Options options = CurrentOptions(); @@ -2985,7 +2973,6 @@ TEST_F(DBBasicTest, BestEffortsRecoveryWithVersionBuildingFailure) { SyncPoint::GetInstance()->ClearAllCallBacks(); } -#ifndef ROCKSDB_LITE namespace { class TableFileListener : public EventListener { public: @@ -3260,7 +3247,6 @@ TEST_F(DBBasicTest, DisableTrackWal) { ASSERT_TRUE(dbfull()->GetVersionSet()->GetWalSet().GetWals().empty()); Close(); } -#endif // !ROCKSDB_LITE TEST_F(DBBasicTest, ManifestChecksumMismatch) { Options options = CurrentOptions(); @@ -3304,7 +3290,6 @@ TEST_F(DBBasicTest, ConcurrentlyCloseDB) { } } -#ifndef ROCKSDB_LITE class DBBasicTestTrackWal : public DBTestBase, public testing::WithParamInterface { public: @@ -3360,7 +3345,6 @@ TEST_P(DBBasicTestTrackWal, DoNotTrackObsoleteWal) { INSTANTIATE_TEST_CASE_P(DBBasicTestTrackWal, DBBasicTestTrackWal, testing::Bool()); -#endif // ROCKSDB_LITE class DBBasicTestMultiGet : public DBTestBase { public: @@ -3382,7 +3366,6 @@ class DBBasicTestMultiGet : public DBTestBase { Random rnd(301); BlockBasedTableOptions table_options; -#ifndef ROCKSDB_LITE if (compression_enabled_) { std::vector compression_types; compression_types = GetSupportedCompressions(); @@ -3401,12 +3384,6 @@ class DBBasicTestMultiGet : public DBTestBase { compression_enabled_ = false; } } -#else - // GetSupportedCompressions() is not available in LITE build - if (!Snappy_Supported()) { - compression_enabled_ = false; - } -#endif // ROCKSDB_LITE table_options.block_cache = uncompressed_cache_; if (table_options.block_cache == nullptr) { @@ -3729,7 +3706,6 @@ TEST_P(DBBasicTestWithParallelIO, MultiGet) { } } -#ifndef ROCKSDB_LITE TEST_P(DBBasicTestWithParallelIO, MultiGetDirectIO) { class FakeDirectIOEnv : public EnvWrapper { class FakeDirectIOSequentialFile; @@ -3846,7 +3822,6 @@ TEST_P(DBBasicTestWithParallelIO, MultiGetDirectIO) { } Close(); } -#endif // ROCKSDB_LITE TEST_P(DBBasicTestWithParallelIO, MultiGetWithChecksumMismatch) { std::vector key_data(10); @@ -4387,7 +4362,6 @@ TEST_F(DBBasicTest, FailOpenIfLoggerCreationFail) { SyncPoint::GetInstance()->ClearAllCallBacks(); } -#ifndef ROCKSDB_LITE TEST_F(DBBasicTest, VerifyFileChecksums) { Options options = GetDefaultOptions(); options.create_if_missing = true; @@ -4453,7 +4427,6 @@ TEST_F(DBBasicTest, DISABLED_ManualWalSync) { ASSERT_TRUE(TryReopen(options).IsCorruption()); } -#endif // !ROCKSDB_LITE // A test class for intercepting random reads and injecting artificial // delays. Used for testing the deadline/timeout feature diff --git a/db/db_block_cache_test.cc b/db/db_block_cache_test.cc index 2656f197f8e..532070afcb4 100644 --- a/db/db_block_cache_test.cc +++ b/db/db_block_cache_test.cc @@ -132,7 +132,6 @@ class DBBlockCacheTest : public DBTestBase { compression_dict_insert_count_ = new_compression_dict_insert_count; } -#ifndef ROCKSDB_LITE const std::array GetCacheEntryRoleCountsBg() { // Verify in cache entry role stats std::array cache_entry_role_counts; @@ -146,7 +145,6 @@ class DBBlockCacheTest : public DBTestBase { } return cache_entry_role_counts; } -#endif // ROCKSDB_LITE }; TEST_F(DBBlockCacheTest, IteratorBlockCacheUsage) { @@ -302,7 +300,6 @@ class ReadOnlyCacheWrapper : public CacheWrapper { } // anonymous namespace #endif // SNAPPY -#ifndef ROCKSDB_LITE // Make sure that when options.block_cache is set, after a new table is // created its index/filter blocks are added to block cache. @@ -1335,7 +1332,6 @@ TEST_F(DBBlockCacheTest, HyperClockCacheReportProblems) { EXPECT_EQ(logger->PopCounts(), (std::array{{0, 1, 0}})); } -#endif // ROCKSDB_LITE class DBBlockCacheKeyTest : public DBTestBase, @@ -1442,7 +1438,6 @@ TEST_P(DBBlockCacheKeyTest, StableCacheKeys) { ++key_count; } -#ifndef ROCKSDB_LITE // Save an export of those ordinary SST files for later std::string export_files_dir = dbname_ + "/exported"; ExportImportFilesMetaData* metadata_ptr_ = nullptr; @@ -1470,7 +1465,6 @@ TEST_P(DBBlockCacheKeyTest, StableCacheKeys) { IngestExternalFileOptions ingest_opts; ASSERT_OK(db_->IngestExternalFile(handles_[1], {f}, ingest_opts)); } -#endif perform_gets(); verify_stats(); @@ -1484,7 +1478,6 @@ TEST_P(DBBlockCacheKeyTest, StableCacheKeys) { // Make sure we can cache hit even on a full copy of the DB. Using // StableCacheKeyTestFS, Checkpoint will resort to full copy not hard link. // (Checkpoint not available in LITE mode to test this.) -#ifndef ROCKSDB_LITE auto db_copy_name = dbname_ + "-copy"; ASSERT_OK(Checkpoint::Create(db_, &checkpoint)); ASSERT_OK(checkpoint->CreateCheckpoint(db_copy_name)); @@ -1523,7 +1516,6 @@ TEST_P(DBBlockCacheKeyTest, StableCacheKeys) { perform_gets(); verify_stats(); -#endif // !ROCKSDB_LITE Close(); Destroy(options); diff --git a/db/db_bloom_filter_test.cc b/db/db_bloom_filter_test.cc index 7bf509abec9..352343c160f 100644 --- a/db/db_bloom_filter_test.cc +++ b/db/db_bloom_filter_test.cc @@ -245,14 +245,12 @@ TEST_F(DBBloomFilterTest, GetFilterByPrefixBloomCustomPrefixExtractor) { (*(get_perf_context()->level_to_perf_context))[0].bloom_filter_useful); // No bloom on extractor changed -#ifndef ROCKSDB_LITE ASSERT_OK(db_->SetOptions({{"prefix_extractor", "capped:10"}})); ASSERT_EQ("NOT_FOUND", Get("foobarbar")); ASSERT_EQ(TestGetTickerCount(options, BLOOM_FILTER_USEFUL), 3); ASSERT_EQ( 3, (*(get_perf_context()->level_to_perf_context))[0].bloom_filter_useful); -#endif // ROCKSDB_LITE // No bloom on extractor changed, after re-open options.prefix_extractor.reset(NewCappedPrefixTransform(10)); @@ -317,14 +315,12 @@ TEST_F(DBBloomFilterTest, GetFilterByPrefixBloom) { (*(get_perf_context()->level_to_perf_context))[0].bloom_filter_useful); // No bloom on extractor changed -#ifndef ROCKSDB_LITE ASSERT_OK(db_->SetOptions({{"prefix_extractor", "capped:10"}})); ASSERT_EQ("NOT_FOUND", Get("foobarbar")); ASSERT_EQ(TestGetTickerCount(options, BLOOM_FILTER_USEFUL), 3); ASSERT_EQ( 3, (*(get_perf_context()->level_to_perf_context))[0].bloom_filter_useful); -#endif // ROCKSDB_LITE get_perf_context()->Reset(); } @@ -564,7 +560,6 @@ TEST_P(DBBloomFilterTestWithParam, BloomFilter) { ASSERT_LE(reads, 3 * N / 100); } -#ifndef ROCKSDB_LITE // Sanity check some table properties std::map props; ASSERT_TRUE(db_->GetMapProperty( @@ -583,7 +578,6 @@ TEST_P(DBBloomFilterTestWithParam, BloomFilter) { uint64_t num_filter_entries = ParseUint64(props["num_filter_entries"]); EXPECT_EQ(num_filter_entries, nkeys); -#endif // ROCKSDB_LITE env_->delay_sstable_sync_.store(false, std::memory_order_release); Close(); @@ -649,10 +643,8 @@ TEST_P(DBBloomFilterTestWithParam, SkipFilterOnEssentiallyZeroBpk) { PutFn(); GetFn(); }; -#ifndef ROCKSDB_LITE std::map props; const auto& kAggTableProps = DB::Properties::kAggregatedTableProperties; -#endif // ROCKSDB_LITE Options options = CurrentOptions(); options.statistics = ROCKSDB_NAMESPACE::CreateDBStatistics(); @@ -675,11 +667,9 @@ TEST_P(DBBloomFilterTestWithParam, SkipFilterOnEssentiallyZeroBpk) { EXPECT_EQ(TestGetTickerCount(options, BLOOM_FILTER_FULL_POSITIVE), 0); EXPECT_EQ(TestGetTickerCount(options, BLOOM_FILTER_FULL_TRUE_POSITIVE), 0); -#ifndef ROCKSDB_LITE props.clear(); ASSERT_TRUE(db_->GetMapProperty(kAggTableProps, &props)); EXPECT_EQ(props["filter_size"], "0"); -#endif // ROCKSDB_LITE // Test 2: use custom API to skip filters -> no filter constructed // or read. @@ -693,11 +683,9 @@ TEST_P(DBBloomFilterTestWithParam, SkipFilterOnEssentiallyZeroBpk) { EXPECT_EQ(TestGetTickerCount(options, BLOOM_FILTER_FULL_POSITIVE), 0); EXPECT_EQ(TestGetTickerCount(options, BLOOM_FILTER_FULL_TRUE_POSITIVE), 0); -#ifndef ROCKSDB_LITE props.clear(); ASSERT_TRUE(db_->GetMapProperty(kAggTableProps, &props)); EXPECT_EQ(props["filter_size"], "0"); -#endif // ROCKSDB_LITE // Control test: using an actual filter with 100% FP rate -> the filter // is constructed and checked on read. @@ -713,11 +701,9 @@ TEST_P(DBBloomFilterTestWithParam, SkipFilterOnEssentiallyZeroBpk) { EXPECT_EQ( TestGetAndResetTickerCount(options, BLOOM_FILTER_FULL_TRUE_POSITIVE), maxKey); -#ifndef ROCKSDB_LITE props.clear(); ASSERT_TRUE(db_->GetMapProperty(kAggTableProps, &props)); EXPECT_NE(props["filter_size"], "0"); -#endif // ROCKSDB_LITE // Test 3 (options test): Able to read existing filters with longstanding // generated options file entry `filter_policy=rocksdb.BuiltinBloomFilter` @@ -743,11 +729,9 @@ TEST_P(DBBloomFilterTestWithParam, SkipFilterOnEssentiallyZeroBpk) { EXPECT_EQ(TestGetTickerCount(options, BLOOM_FILTER_FULL_POSITIVE), 0); EXPECT_EQ(TestGetTickerCount(options, BLOOM_FILTER_FULL_TRUE_POSITIVE), 0); -#ifndef ROCKSDB_LITE props.clear(); ASSERT_TRUE(db_->GetMapProperty(kAggTableProps, &props)); EXPECT_EQ(props["filter_size"], "0"); -#endif // ROCKSDB_LITE } #if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) @@ -1503,7 +1487,6 @@ TEST_P(DBFilterConstructionCorruptionTestWithParam, DetectCorruption) { } // RocksDB lite does not support dynamic options -#ifndef ROCKSDB_LITE TEST_P(DBFilterConstructionCorruptionTestWithParam, DynamicallyTurnOnAndOffDetectConstructCorruption) { Options options = CurrentOptions(); @@ -1587,7 +1570,6 @@ TEST_P(DBFilterConstructionCorruptionTestWithParam, db_->GetOptions().table_factory->GetOptions(); EXPECT_FALSE(updated_table_options->detect_filter_construct_corruption); } -#endif // ROCKSDB_LITE namespace { // NOTE: This class is referenced by HISTORY.md as a model for a wrapper @@ -1756,7 +1738,6 @@ TEST_F(DBBloomFilterTest, ContextCustomFilterPolicy) { EXPECT_LE(useful_count, maxKey * 0.91); } } else { -#ifndef ROCKSDB_LITE // Also try external SST file { std::string file_path = dbname_ + "/external.sst"; @@ -1768,7 +1749,6 @@ TEST_F(DBBloomFilterTest, ContextCustomFilterPolicy) { // Note: kCompactionStyleLevel is default, ignored if num_levels == -1 EXPECT_EQ(policy->DumpTestReport(), "cf=abe,s=kCompactionStyleLevel,n=-1,l=-1,b=0,r=kMisc\n"); -#endif } // Destroy @@ -2036,9 +2016,7 @@ TEST_P(DBBloomFilterTestVaryPrefixAndFormatVer, PartitionedMultiGet) { ASSERT_OK(Put(UKey(i), UKey(i))); } ASSERT_OK(Flush()); -#ifndef ROCKSDB_LITE ASSERT_EQ(TotalTableFiles(), 1); -#endif constexpr uint32_t Q = 29; // MultiGet In @@ -2190,7 +2168,6 @@ INSTANTIATE_TEST_CASE_P(DBBloomFilterTestVaryPrefixAndFormatVer, std::make_tuple(true, 3), std::make_tuple(true, 4), std::make_tuple(true, 5))); -#ifndef ROCKSDB_LITE namespace { static const std::string kPlainTable = "test_PlainTableBloom"; } // anonymous namespace @@ -3486,7 +3463,6 @@ TEST_F(DBBloomFilterTest, WeirdPrefixExtractorWithFilter3) { } } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_compaction_filter_test.cc b/db/db_compaction_filter_test.cc index be863d4f66b..0b3f3dedca8 100644 --- a/db/db_compaction_filter_test.cc +++ b/db/db_compaction_filter_test.cc @@ -285,7 +285,6 @@ class ChangeFilterFactory : public CompactionFilterFactory { const char* Name() const override { return "ChangeFilterFactory"; } }; -#ifndef ROCKSDB_LITE TEST_F(DBTestCompactionFilter, CompactionFilter) { Options options = CurrentOptions(); options.max_open_files = -1; @@ -469,7 +468,6 @@ TEST_F(DBTestCompactionFilter, CompactionFilterDeletesAll) { delete itr; } -#endif // ROCKSDB_LITE TEST_F(DBTestCompactionFilter, CompactionFilterFlush) { // Tests a `CompactionFilterFactory` that filters when table file is created @@ -655,7 +653,6 @@ TEST_F(DBTestCompactionFilter, CompactionFilterWithMergeOperator) { ASSERT_EQ(newvalue, four); } -#ifndef ROCKSDB_LITE TEST_F(DBTestCompactionFilter, CompactionFilterContextManual) { KeepFilterFactory* filter = new KeepFilterFactory(true, true); @@ -715,7 +712,6 @@ TEST_F(DBTestCompactionFilter, CompactionFilterContextManual) { ASSERT_EQ(count, 0); } } -#endif // ROCKSDB_LITE TEST_F(DBTestCompactionFilter, CompactionFilterContextCfId) { KeepFilterFactory* filter = new KeepFilterFactory(false, true); @@ -746,7 +742,6 @@ TEST_F(DBTestCompactionFilter, CompactionFilterContextCfId) { ASSERT_TRUE(filter->compaction_filter_created()); } -#ifndef ROCKSDB_LITE // Compaction filters aplies to all records, regardless snapshots. TEST_F(DBTestCompactionFilter, CompactionFilterIgnoreSnapshot) { std::string five = std::to_string(5); @@ -807,7 +802,6 @@ TEST_F(DBTestCompactionFilter, CompactionFilterIgnoreSnapshot) { // removed. db_->ReleaseSnapshot(snapshot); } -#endif // ROCKSDB_LITE TEST_F(DBTestCompactionFilter, SkipUntil) { Options options = CurrentOptions(); diff --git a/db/db_compaction_test.cc b/db/db_compaction_test.cc index 6591ac41f93..70b47b0cd11 100644 --- a/db/db_compaction_test.cc +++ b/db/db_compaction_test.cc @@ -30,7 +30,6 @@ namespace ROCKSDB_NAMESPACE { // SYNC_POINT is not supported in released Windows mode. -#if !defined(ROCKSDB_LITE) class CompactionStatsCollector : public EventListener { public: @@ -9056,18 +9055,11 @@ TEST_F(DBCompactionTest, BottommostFileCompactionAllowIngestBehind) { // ASSERT_OK(dbfull()->TEST_WaitForCompact(true /* wait_unscheduled */)); } -#endif // !defined(ROCKSDB_LITE) } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { -#if !defined(ROCKSDB_LITE) ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -#else - (void)argc; - (void)argv; - return 0; -#endif } diff --git a/db/db_dynamic_level_test.cc b/db/db_dynamic_level_test.cc index 17fa67cb200..a1c2fa943a3 100644 --- a/db/db_dynamic_level_test.cc +++ b/db/db_dynamic_level_test.cc @@ -10,7 +10,6 @@ // Introduction of SyncPoint effectively disabled building and running this test // in Release build. // which is a pity, it is a good test -#if !defined(ROCKSDB_LITE) #include "db/db_test_util.h" #include "port/port.h" @@ -492,16 +491,9 @@ TEST_F(DBTestDynamicLevel, DISABLED_MigrateToDynamicLevelMaxBytesBase) { } } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) int main(int argc, char** argv) { -#if !defined(ROCKSDB_LITE) ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -#else - (void)argc; - (void)argv; - return 0; -#endif } diff --git a/db/db_encryption_test.cc b/db/db_encryption_test.cc index 73e89d158bd..fc8be5b6948 100644 --- a/db/db_encryption_test.cc +++ b/db/db_encryption_test.cc @@ -6,9 +6,7 @@ #include "db/db_test_util.h" #include "port/stack_trace.h" #include "rocksdb/perf_context.h" -#if !defined(ROCKSDB_LITE) #include "test_util/sync_point.h" -#endif #include #include @@ -27,7 +25,6 @@ class DBEncryptionTest : public DBTestBase { } }; -#ifndef ROCKSDB_LITE TEST_F(DBEncryptionTest, CheckEncrypted) { ASSERT_OK(Put("foo567", "v1.fetdq")); @@ -119,7 +116,6 @@ TEST_F(DBEncryptionTest, ReadEmptyFile) { ASSERT_TRUE(data.empty()); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_filesnapshot.cc b/db/db_filesnapshot.cc index aa9bd738a51..6ca7685aedd 100644 --- a/db/db_filesnapshot.cc +++ b/db/db_filesnapshot.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include #include @@ -439,4 +438,3 @@ Status DBImpl::GetLiveFilesStorageInfo( } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/db_flush_test.cc b/db/db_flush_test.cc index 0587afb3a5b..ca331b86a44 100644 --- a/db/db_flush_test.cc +++ b/db/db_flush_test.cc @@ -73,9 +73,7 @@ TEST_F(DBFlushTest, FlushWhileWritingManifest) { ASSERT_OK(dbfull()->Flush(no_wait)); // If the issue is hit we will wait here forever. ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable()); -#ifndef ROCKSDB_LITE ASSERT_EQ(2, TotalTableFiles()); -#endif // ROCKSDB_LITE } // Disable this test temporarily on Travis as it fails intermittently. @@ -105,9 +103,7 @@ TEST_F(DBFlushTest, SyncFail) { // Now the background job will do the flush; wait for it. // Returns the IO error happend during flush. ASSERT_NOK(dbfull()->TEST_WaitForFlushMemTable()); -#ifndef ROCKSDB_LITE ASSERT_EQ("", FilesPerLevel()); // flush failed. -#endif // ROCKSDB_LITE Destroy(options); } @@ -664,7 +660,6 @@ TEST_F(DBFlushTest, StatisticsGarbageRangeDeletes) { Close(); } -#ifndef ROCKSDB_LITE // This simple Listener can only handle one flush at a time. class TestFlushListener : public EventListener { public: @@ -744,10 +739,8 @@ class TestFlushListener : public EventListener { Env* env_; DBFlushTest* test_; }; -#endif // !ROCKSDB_LITE // RocksDB lite does not support GetLiveFiles() -#ifndef ROCKSDB_LITE TEST_F(DBFlushTest, FixFlushReasonRaceFromConcurrentFlushes) { Options options = CurrentOptions(); options.atomic_flush = true; @@ -802,7 +795,6 @@ TEST_F(DBFlushTest, FixFlushReasonRaceFromConcurrentFlushes) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#endif // !ROCKSDB_LITE TEST_F(DBFlushTest, MemPurgeBasic) { Options options = CurrentOptions(); @@ -835,24 +827,16 @@ TEST_F(DBFlushTest, MemPurgeBasic) { // Enforce size of a single MemTable to 64MB (64MB = 67108864 bytes). options.write_buffer_size = 1 << 20; -#ifndef ROCKSDB_LITE // Initially deactivate the MemPurge prototype. options.experimental_mempurge_threshold = 0.0; TestFlushListener* listener = new TestFlushListener(options.env, this); options.listeners.emplace_back(listener); -#else - // Activate directly the MemPurge prototype. - // (RocksDB lite does not support dynamic options) - options.experimental_mempurge_threshold = 1.0; -#endif // !ROCKSDB_LITE ASSERT_OK(TryReopen(options)); // RocksDB lite does not support dynamic options -#ifndef ROCKSDB_LITE // Dynamically activate the MemPurge prototype without restarting the DB. ColumnFamilyHandle* cfh = db_->DefaultColumnFamily(); ASSERT_OK(db_->SetOptions(cfh, {{"experimental_mempurge_threshold", "1.0"}})); -#endif std::atomic mempurge_count{0}; std::atomic sst_count{0}; @@ -985,7 +969,6 @@ TEST_F(DBFlushTest, MemPurgeBasic) { } // RocksDB lite does not support dynamic options -#ifndef ROCKSDB_LITE TEST_F(DBFlushTest, MemPurgeBasicToggle) { Options options = CurrentOptions(); @@ -1098,12 +1081,10 @@ TEST_F(DBFlushTest, MemPurgeBasicToggle) { Close(); } -// Closes the "#ifndef ROCKSDB_LITE" // End of MemPurgeBasicToggle, which is not // supported with RocksDB LITE because it // relies on dynamically changing the option // flag experimental_mempurge_threshold. -#endif // At the moment, MemPurge feature is deactivated // when atomic_flush is enabled. This is because the level @@ -1221,10 +1202,8 @@ TEST_F(DBFlushTest, MemPurgeDeleteAndDeleteRange) { options.compression = kNoCompression; options.inplace_update_support = false; options.allow_concurrent_memtable_write = true; -#ifndef ROCKSDB_LITE TestFlushListener* listener = new TestFlushListener(options.env, this); options.listeners.emplace_back(listener); -#endif // !ROCKSDB_LITE // Enforce size of a single MemTable to 64MB (64MB = 67108864 bytes). options.write_buffer_size = 1 << 20; // Activate the MemPurge prototype. @@ -1422,10 +1401,8 @@ TEST_F(DBFlushTest, MemPurgeAndCompactionFilter) { options.compression = kNoCompression; options.inplace_update_support = false; options.allow_concurrent_memtable_write = true; -#ifndef ROCKSDB_LITE TestFlushListener* listener = new TestFlushListener(options.env, this); options.listeners.emplace_back(listener); -#endif // !ROCKSDB_LITE // Create a ConditionalUpdate compaction filter // that will update all the values of the KV pairs // where the keys are "lower" than KEY4. @@ -1878,12 +1855,10 @@ TEST_F(DBFlushTest, ManualFlushFailsInReadOnlyMode) { ASSERT_OK(db_->ContinueBackgroundWork()); // We ingested the error to env, so the returned status is not OK. ASSERT_NOK(dbfull()->TEST_WaitForFlushMemTable()); -#ifndef ROCKSDB_LITE uint64_t num_bg_errors; ASSERT_TRUE( db_->GetIntProperty(DB::Properties::kBackgroundErrors, &num_bg_errors)); ASSERT_GT(num_bg_errors, 0); -#endif // ROCKSDB_LITE // In the bug scenario, triggering another flush would cause the second flush // to hang forever. After the fix we expect it to return an error. @@ -1925,7 +1900,6 @@ TEST_F(DBFlushTest, CFDropRaceWithWaitForFlushMemTables) { SyncPoint::GetInstance()->DisableProcessing(); } -#ifndef ROCKSDB_LITE TEST_F(DBFlushTest, FireOnFlushCompletedAfterCommittedResult) { class TestListener : public EventListener { public: @@ -2016,7 +1990,6 @@ TEST_F(DBFlushTest, FireOnFlushCompletedAfterCommittedResult) { SyncPoint::GetInstance()->DisableProcessing(); SyncPoint::GetInstance()->ClearAllCallBacks(); } -#endif // !ROCKSDB_LITE TEST_F(DBFlushTest, FlushWithBlob) { constexpr uint64_t min_blob_size = 10; @@ -2078,7 +2051,6 @@ TEST_F(DBFlushTest, FlushWithBlob) { ASSERT_EQ(blob_file->GetTotalBlobCount(), 1); -#ifndef ROCKSDB_LITE const InternalStats* const internal_stats = cfd->internal_stats(); assert(internal_stats); @@ -2094,7 +2066,6 @@ TEST_F(DBFlushTest, FlushWithBlob) { ASSERT_EQ(cf_stats_value[InternalStats::BYTES_FLUSHED], compaction_stats[0].bytes_written + compaction_stats[0].bytes_written_blob); -#endif // ROCKSDB_LITE } TEST_F(DBFlushTest, FlushWithChecksumHandoff1) { @@ -2408,7 +2379,6 @@ TEST_P(DBFlushTestBlobError, FlushError) { ASSERT_NE(type, kBlobFile); } -#ifndef ROCKSDB_LITE const InternalStats* const internal_stats = cfd->internal_stats(); assert(internal_stats); @@ -2432,10 +2402,8 @@ TEST_P(DBFlushTestBlobError, FlushError) { ASSERT_EQ(cf_stats_value[InternalStats::BYTES_FLUSHED], compaction_stats[0].bytes_written + compaction_stats[0].bytes_written_blob); -#endif // ROCKSDB_LITE } -#ifndef ROCKSDB_LITE TEST_F(DBFlushTest, TombstoneVisibleInSnapshot) { class SimpleTestFlushListener : public EventListener { public: @@ -2616,7 +2584,6 @@ TEST_P(DBAtomicFlushTest, ManualAtomicFlush) { ASSERT_TRUE(cfh->cfd()->mem()->IsEmpty()); } } -#endif // ROCKSDB_LITE TEST_P(DBAtomicFlushTest, PrecomputeMinLogNumberToKeepNon2PC) { Options options = CurrentOptions(); diff --git a/db/db_impl/compacted_db_impl.cc b/db/db_impl/compacted_db_impl.cc index f18ee0d7239..70de798589c 100644 --- a/db/db_impl/compacted_db_impl.cc +++ b/db/db_impl/compacted_db_impl.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/db_impl/compacted_db_impl.h" #include "db/db_impl/db_impl.h" @@ -254,4 +253,3 @@ Status CompactedDBImpl::Open(const Options& options, const std::string& dbname, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/db_impl/compacted_db_impl.h b/db/db_impl/compacted_db_impl.h index eb458b85d4e..e0e0d566494 100644 --- a/db/db_impl/compacted_db_impl.h +++ b/db/db_impl/compacted_db_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -133,12 +132,10 @@ class CompactedDBImpl : public DBImpl { // Share with DBImplReadOnly? protected: -#ifndef ROCKSDB_LITE Status FlushForGetLiveFiles() override { // No-op for read-only DB return Status::OK(); } -#endif // !ROCKSDB_LITE private: friend class DB; @@ -151,4 +148,3 @@ class CompactedDBImpl : public DBImpl { LevelFilesBrief files_; }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc index 24fb5389060..2acf9b2fb2e 100644 --- a/db/db_impl/db_impl.cc +++ b/db/db_impl/db_impl.cc @@ -213,17 +213,13 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname, has_unpersisted_data_(false), unable_to_release_oldest_log_(false), num_running_ingest_file_(0), -#ifndef ROCKSDB_LITE wal_manager_(immutable_db_options_, file_options_, io_tracer_, seq_per_batch), -#endif // ROCKSDB_LITE bg_work_paused_(0), bg_compaction_paused_(0), refitting_level_(false), opened_successfully_(false), -#ifndef ROCKSDB_LITE periodic_task_scheduler_(), -#endif // ROCKSDB_LITE two_write_queues_(options.two_write_queues), manual_wal_flush_(options.manual_wal_flush), // last_sequencee_ is always maintained by the main queue that also writes @@ -265,7 +261,6 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname, SetDbSessionId(); assert(!db_session_id_.empty()); -#ifndef ROCKSDB_LITE periodic_task_functions_.emplace(PeriodicTaskType::kDumpStats, [this]() { this->DumpStats(); }); periodic_task_functions_.emplace(PeriodicTaskType::kPersistStats, @@ -275,7 +270,6 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname, periodic_task_functions_.emplace( PeriodicTaskType::kRecordSeqnoTime, [this]() { this->RecordSeqnoToTimeMapping(); }); -#endif // ROCKSDB_LITE versions_.reset(new VersionSet(dbname_, &immutable_db_options_, file_options_, table_cache_.get(), write_buffer_manager_, @@ -496,7 +490,6 @@ void DBImpl::CancelAllBackgroundWork(bool wait) { ROCKS_LOG_INFO(immutable_db_options_.info_log, "Shutdown: canceling all background work"); -#ifndef ROCKSDB_LITE for (uint8_t task_type = 0; task_type < static_cast(PeriodicTaskType::kMax); task_type++) { Status s = periodic_task_scheduler_.Unregister( @@ -507,7 +500,6 @@ void DBImpl::CancelAllBackgroundWork(bool wait) { task_type, s.ToString().c_str()); } } -#endif // !ROCKSDB_LITE InstrumentedMutexLock l(&mutex_); if (!shutting_down_.load(std::memory_order_acquire) && @@ -704,7 +696,6 @@ Status DBImpl::CloseHelper() { ROCKS_LOG_INFO(immutable_db_options_.info_log, "Shutdown complete"); LogFlush(immutable_db_options_.info_log); -#ifndef ROCKSDB_LITE // If the sst_file_manager was allocated by us during DB::Open(), ccall // Close() on it before closing the info_log. Otherwise, background thread // in SstFileManagerImpl might try to log something @@ -713,7 +704,6 @@ Status DBImpl::CloseHelper() { immutable_db_options_.sst_file_manager.get()); sfm->Close(); } -#endif // ROCKSDB_LITE if (immutable_db_options_.info_log && own_info_log_) { Status s = immutable_db_options_.info_log->Close(); @@ -791,7 +781,6 @@ void DBImpl::PrintStatistics() { } Status DBImpl::StartPeriodicTaskScheduler() { -#ifndef ROCKSDB_LITE #ifndef NDEBUG // It only used by test to disable scheduler @@ -834,13 +823,9 @@ Status DBImpl::StartPeriodicTaskScheduler() { periodic_task_functions_.at(PeriodicTaskType::kFlushInfoLog)); return s; -#else - return Status::OK(); -#endif // !ROCKSDB_LITE } Status DBImpl::RegisterRecordSeqnoTimeWorker() { -#ifndef ROCKSDB_LITE uint64_t min_time_duration = std::numeric_limits::max(); uint64_t max_time_duration = std::numeric_limits::min(); { @@ -883,9 +868,6 @@ Status DBImpl::RegisterRecordSeqnoTimeWorker() { } return s; -#else - return Status::OK(); -#endif // !ROCKSDB_LITE } // esitmate the total size of stats_history_ @@ -906,7 +888,6 @@ size_t DBImpl::EstimateInMemoryStatsHistorySize() const { void DBImpl::PersistStats() { TEST_SYNC_POINT("DBImpl::PersistStats:Entry"); -#ifndef ROCKSDB_LITE if (shutdown_initiated_) { return; } @@ -1011,7 +992,6 @@ void DBImpl::PersistStats() { stats_history_size, stats_history_.size()); } TEST_SYNC_POINT("DBImpl::PersistStats:End"); -#endif // !ROCKSDB_LITE } bool DBImpl::FindStatsByTime(uint64_t start_time, uint64_t end_time, @@ -1053,7 +1033,6 @@ Status DBImpl::GetStatsHistory( void DBImpl::DumpStats() { TEST_SYNC_POINT("DBImpl::DumpStats:1"); -#ifndef ROCKSDB_LITE std::string stats; if (shutdown_initiated_) { return; @@ -1118,7 +1097,6 @@ void DBImpl::DumpStats() { ROCKS_LOG_INFO(immutable_db_options_.info_log, "%s", stats.c_str()); } } -#endif // !ROCKSDB_LITE PrintStatistics(); } @@ -1173,11 +1151,6 @@ FSDirectory* DBImpl::GetDataDir(ColumnFamilyData* cfd, size_t path_id) const { Status DBImpl::SetOptions( ColumnFamilyHandle* column_family, const std::unordered_map& options_map) { -#ifdef ROCKSDB_LITE - (void)column_family; - (void)options_map; - return Status::NotSupported("Not supported in ROCKSDB LITE"); -#else auto* cfd = static_cast_with_check(column_family)->cfd(); if (options_map.empty()) { @@ -1235,15 +1208,10 @@ Status DBImpl::SetOptions( } LogFlush(immutable_db_options_.info_log); return s; -#endif // ROCKSDB_LITE } Status DBImpl::SetDBOptions( const std::unordered_map& options_map) { -#ifdef ROCKSDB_LITE - (void)options_map; - return Status::NotSupported("Not supported in ROCKSDB LITE"); -#else if (options_map.empty()) { ROCKS_LOG_WARN(immutable_db_options_.info_log, "SetDBOptions(), empty input."); @@ -1408,7 +1376,6 @@ Status DBImpl::SetDBOptions( } LogFlush(immutable_db_options_.info_log); return s; -#endif // ROCKSDB_LITE } // return the same level if it cannot be moved @@ -3295,11 +3262,6 @@ Iterator* DBImpl::NewIterator(const ReadOptions& read_options, assert(cfd != nullptr); ReadCallback* read_callback = nullptr; // No read callback provided. if (read_options.tailing) { -#ifdef ROCKSDB_LITE - // not supported in lite version - result = nullptr; - -#else SuperVersion* sv = cfd->GetReferencedSuperVersion(this); auto iter = new ForwardIterator(this, read_options, cfd, sv, /* allow_unprepared_value */ true); @@ -3308,7 +3270,6 @@ Iterator* DBImpl::NewIterator(const ReadOptions& read_options, cfd->user_comparator(), iter, sv->current, kMaxSequenceNumber, sv->mutable_cf_options.max_sequential_skip_in_iterations, read_callback, this, cfd); -#endif } else { // Note: no need to consider the special case of // last_seq_same_as_publish_seq_==false since NewIterator is overridden in @@ -3439,10 +3400,6 @@ Status DBImpl::NewIterators( iterators->clear(); iterators->reserve(column_families.size()); if (read_options.tailing) { -#ifdef ROCKSDB_LITE - return Status::InvalidArgument( - "Tailing iterator not supported in RocksDB lite"); -#else for (auto cfh : column_families) { auto cfd = static_cast_with_check(cfh)->cfd(); SuperVersion* sv = cfd->GetReferencedSuperVersion(this); @@ -3454,7 +3411,6 @@ Status DBImpl::NewIterators( sv->mutable_cf_options.max_sequential_skip_in_iterations, read_callback, this, cfd)); } -#endif } else { // Note: no need to consider the special case of // last_seq_same_as_publish_seq_==false since NewIterators is overridden in @@ -3476,11 +3432,9 @@ Status DBImpl::NewIterators( const Snapshot* DBImpl::GetSnapshot() { return GetSnapshotImpl(false); } -#ifndef ROCKSDB_LITE const Snapshot* DBImpl::GetSnapshotForWriteConflictBoundary() { return GetSnapshotImpl(true); } -#endif // ROCKSDB_LITE std::pair> DBImpl::CreateTimestampedSnapshot(SequenceNumber snapshot_seq, uint64_t ts) { @@ -3728,7 +3682,6 @@ void DBImpl::ReleaseSnapshot(const Snapshot* s) { delete casted_s; } -#ifndef ROCKSDB_LITE Status DBImpl::GetPropertiesOfAllTables(ColumnFamilyHandle* column_family, TablePropertiesCollection* props) { auto cfh = static_cast_with_check(column_family); @@ -3772,7 +3725,6 @@ Status DBImpl::GetPropertiesOfTablesInRange(ColumnFamilyHandle* column_family, return s; } -#endif // ROCKSDB_LITE const std::string& DBImpl::GetName() const { return dbname_; } @@ -3791,7 +3743,6 @@ SystemClock* DBImpl::GetSystemClock() const { return immutable_db_options_.clock; } -#ifndef ROCKSDB_LITE Status DBImpl::StartIOTrace(const TraceOptions& trace_options, std::unique_ptr&& trace_writer) { @@ -3805,7 +3756,6 @@ Status DBImpl::EndIOTrace() { return Status::OK(); } -#endif // ROCKSDB_LITE Options DBImpl::GetOptions(ColumnFamilyHandle* column_family) const { InstrumentedMutexLock l(&mutex_); @@ -3934,7 +3884,6 @@ bool DBImpl::GetPropertyHandleOptionsStatistics(std::string* value) { return true; } -#ifndef ROCKSDB_LITE Status DBImpl::ResetStats() { InstrumentedMutexLock l(&mutex_); for (auto* cfd : *versions_->GetColumnFamilySet()) { @@ -3944,7 +3893,6 @@ Status DBImpl::ResetStats() { } return Status::OK(); } -#endif // ROCKSDB_LITE bool DBImpl::GetAggregatedIntProperty(const Slice& property, uint64_t* aggregated_value) { @@ -4153,7 +4101,6 @@ void DBImpl::ReleaseFileNumberFromPendingOutputs( } } -#ifndef ROCKSDB_LITE Status DBImpl::GetUpdatesSince( SequenceNumber seq, std::unique_ptr* iter, const TransactionLogIterator::ReadOptions& read_options) { @@ -4402,7 +4349,6 @@ void DBImpl::GetAllColumnFamilyMetaData( } } -#endif // ROCKSDB_LITE Status DBImpl::CheckConsistency() { mutex_.AssertHeld(); @@ -4753,7 +4699,6 @@ Status DestroyDB(const std::string& dbname, const Options& options, Status DBImpl::WriteOptionsFile(bool need_mutex_lock, bool need_enter_write_thread) { -#ifndef ROCKSDB_LITE WriteThread::Writer w; if (need_mutex_lock) { mutex_.Lock(); @@ -4810,14 +4755,9 @@ Status DBImpl::WriteOptionsFile(bool need_mutex_lock, s.ToString().c_str()); } } -#else - (void)need_mutex_lock; - (void)need_enter_write_thread; -#endif // !ROCKSDB_LITE return Status::OK(); } -#ifndef ROCKSDB_LITE namespace { void DeleteOptionsFilesHelper(const std::map& filenames, const size_t num_files_to_keep, @@ -4835,10 +4775,8 @@ void DeleteOptionsFilesHelper(const std::map& filenames, } } } // namespace -#endif // !ROCKSDB_LITE Status DBImpl::DeleteObsoleteOptionsFiles() { -#ifndef ROCKSDB_LITE std::vector filenames; // use ordered map to store keep the filenames sorted from the newest // to the oldest. @@ -4866,13 +4804,9 @@ Status DBImpl::DeleteObsoleteOptionsFiles() { DeleteOptionsFilesHelper(options_filenames, kNumOptionsFilesKept, immutable_db_options_.info_log, GetEnv()); return Status::OK(); -#else - return Status::OK(); -#endif // !ROCKSDB_LITE } Status DBImpl::RenameTempFileToOptionsFile(const std::string& file_name) { -#ifndef ROCKSDB_LITE Status s; uint64_t options_file_number = versions_->NewFileNumber(); @@ -4916,10 +4850,6 @@ Status DBImpl::RenameTempFileToOptionsFile(const std::string& file_name) { DeleteObsoleteOptionsFiles().PermitUncheckedError(); } return s; -#else - (void)file_name; - return Status::OK(); -#endif // !ROCKSDB_LITE } #ifdef ROCKSDB_USING_THREAD_STATUS @@ -4967,7 +4897,6 @@ void DumpRocksDBBuildVersion(Logger* log) { } } -#ifndef ROCKSDB_LITE SequenceNumber DBImpl::GetEarliestMemTableSequenceNumber(SuperVersion* sv, bool include_history) { // Find the earliest sequence number that we know we can rely on reading @@ -5924,6 +5853,5 @@ void DBImpl::RecordSeqnoToTimeMapping() { seqno, unix_time); } } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_impl/db_impl.h b/db/db_impl/db_impl.h index 1bab7c7a912..72d7e08f790 100644 --- a/db/db_impl/db_impl.h +++ b/db/db_impl/db_impl.h @@ -54,13 +54,9 @@ #include "rocksdb/env.h" #include "rocksdb/memtablerep.h" #include "rocksdb/status.h" -#ifndef ROCKSDB_LITE #include "rocksdb/trace_reader_writer.h" -#endif // ROCKSDB_LITE #include "rocksdb/transaction_log.h" -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/replayer.h" -#endif // ROCKSDB_LITE #include "rocksdb/write_buffer_manager.h" #include "table/merging_iterator.h" #include "table/scoped_arena_iterator.h" @@ -469,7 +465,6 @@ class DBImpl : public DB { uint64_t start_time, uint64_t end_time, std::unique_ptr* stats_iterator) override; -#ifndef ROCKSDB_LITE using DB::ResetStats; virtual Status ResetStats() override; // All the returned filenames start with "/" @@ -597,7 +592,6 @@ class DBImpl : public DB { ColumnFamilyHandle* column_family, const Range* range, std::size_t n, TablePropertiesCollection* props) override; -#endif // ROCKSDB_LITE // ---- End of implementations of the DB interface ---- SystemClock* GetSystemClock() const; @@ -655,7 +649,6 @@ class DBImpl : public DB { // depends also on data written to the WAL but not to the memtable. SequenceNumber TEST_GetLastVisibleSequence() const; -#ifndef ROCKSDB_LITE // Similar to Write() but will call the callback once on the single write // thread to determine whether it is safe to perform the write. virtual Status WriteWithCallback(const WriteOptions& write_options, @@ -720,7 +713,6 @@ class DBImpl : public DB { Status TraceIteratorSeekForPrev(const uint32_t& cf_id, const Slice& key, const Slice& lower_bound, const Slice upper_bound); -#endif // ROCKSDB_LITE // Similar to GetSnapshot(), but also lets the db know that this snapshot // will be used for transaction write-conflict checking. The DB can then @@ -1176,9 +1168,7 @@ class DBImpl : public DB { return files_grabbed_for_purge_; } -#ifndef ROCKSDB_LITE const PeriodicTaskScheduler& TEST_GetPeriodicTaskScheduler() const; -#endif // !ROCKSDB_LITE #endif // NDEBUG @@ -1401,12 +1391,10 @@ class DBImpl : public DB { void NotifyOnMemTableSealed(ColumnFamilyData* cfd, const MemTableInfo& mem_table_info); -#ifndef ROCKSDB_LITE void NotifyOnExternalFileIngested( ColumnFamilyData* cfd, const ExternalSstFileIngestionJob& ingestion_job); virtual Status FlushForGetLiveFiles(); -#endif // !ROCKSDB_LITE void NewThreadStatusCfInfo(ColumnFamilyData* cfd) const; @@ -1554,9 +1542,7 @@ class DBImpl : public DB { friend class WriteUnpreparedTxnDB; friend class WriteUnpreparedTxn; -#ifndef ROCKSDB_LITE friend class ForwardIterator; -#endif friend struct SuperVersion; friend class CompactedDBImpl; friend class DBTest_ConcurrentFlushWAL_Test; @@ -2023,7 +2009,6 @@ class DBImpl : public DB { // Used by WriteImpl to update bg_error_ in case of memtable insert error. void MemTableInsertStatusCheck(const Status& memtable_insert_status); -#ifndef ROCKSDB_LITE Status CompactFilesImpl(const CompactionOptions& compact_options, ColumnFamilyData* cfd, Version* version, const std::vector& input_file_names, @@ -2031,7 +2016,6 @@ class DBImpl : public DB { const int output_level, int output_path_id, JobContext* job_context, LogBuffer* log_buffer, CompactionJobInfo* compaction_job_info); -#endif // ROCKSDB_LITE ColumnFamilyData* GetColumnFamilyDataByName(const std::string& cf_name); @@ -2170,7 +2154,6 @@ class DBImpl : public DB { bool ShouldntRunManualCompaction(ManualCompactionState* m); bool HaveManualCompaction(ColumnFamilyData* cfd); bool MCOverlap(ManualCompactionState* m, ManualCompactionState* m1); -#ifndef ROCKSDB_LITE void BuildCompactionJobInfo(const ColumnFamilyData* cfd, Compaction* c, const Status& st, const CompactionJobStats& compaction_job_stats, @@ -2183,7 +2166,6 @@ class DBImpl : public DB { ColumnFamilyData* cfd, uint64_t num, std::unique_ptr::iterator>& pending_output_elem, uint64_t* next_file_number); -#endif //! ROCKSDB_LITE bool ShouldPurge(uint64_t file_number) const; void MarkAsGrabbedForPurge(uint64_t file_number); @@ -2593,9 +2575,7 @@ class DBImpl : public DB { // REQUIRES: mutex held int num_running_ingest_file_; -#ifndef ROCKSDB_LITE WalManager wal_manager_; -#endif // ROCKSDB_LITE // A value of > 0 temporarily disables scheduling of background work int bg_work_paused_; @@ -2623,14 +2603,12 @@ class DBImpl : public DB { // Only to be set during initialization std::unique_ptr recoverable_state_pre_release_callback_; -#ifndef ROCKSDB_LITE // Scheduler to run DumpStats(), PersistStats(), and FlushInfoLog(). // Currently, internally it has a global timer instance for running the tasks. PeriodicTaskScheduler periodic_task_scheduler_; // It contains the implementations for each periodic task. std::map periodic_task_functions_; -#endif // When set, we use a separate queue for writes that don't write to memtable. // In 2PC these are the writes at Prepare phase. diff --git a/db/db_impl/db_impl_compaction_flush.cc b/db/db_impl/db_impl_compaction_flush.cc index b52ad589652..ae6ea5bfa9a 100644 --- a/db/db_impl/db_impl_compaction_flush.cc +++ b/db/db_impl/db_impl_compaction_flush.cc @@ -30,7 +30,6 @@ bool DBImpl::EnoughRoomForCompaction( bool* sfm_reserved_compact_space, LogBuffer* log_buffer) { // Check if we have enough room to do the compaction bool enough_room = true; -#ifndef ROCKSDB_LITE auto sfm = static_cast( immutable_db_options_.sst_file_manager.get()); if (sfm) { @@ -45,11 +44,6 @@ bool DBImpl::EnoughRoomForCompaction( *sfm_reserved_compact_space = true; } } -#else - (void)cfd; - (void)inputs; - (void)sfm_reserved_compact_space; -#endif // ROCKSDB_LITE if (!enough_room) { // Just in case tests want to change the value of enough_room TEST_SYNC_POINT_CALLBACK( @@ -259,11 +253,9 @@ Status DBImpl::FlushMemTableToOutputFile( TEST_SYNC_POINT_CALLBACK( "DBImpl::FlushMemTableToOutputFile:AfterPickMemtables", &flush_job); -#ifndef ROCKSDB_LITE // may temporarily unlock and lock the mutex. NotifyOnFlushBegin(cfd, &file_meta, mutable_cf_options, job_context->job_id, flush_reason); -#endif // ROCKSDB_LITE bool switched_to_mempurge = false; // Within flush_job.Run, rocksdb may call event listener to notify @@ -344,7 +336,6 @@ Status DBImpl::FlushMemTableToOutputFile( // If flush ran smoothly and no mempurge happened // install new SST file path. if (s.ok() && (!switched_to_mempurge)) { -#ifndef ROCKSDB_LITE // may temporarily unlock and lock the mutex. NotifyOnFlushCompleted(cfd, mutable_cf_options, flush_job.GetCommittedFlushJobsInfo()); @@ -367,7 +358,6 @@ Status DBImpl::FlushMemTableToOutputFile( error_handler_.SetBGError(new_bg_error, BackgroundErrorReason::kFlush); } } -#endif // ROCKSDB_LITE } TEST_SYNC_POINT("DBImpl::FlushMemTableToOutputFile:Finish"); return s; @@ -486,7 +476,6 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles( IOStatus log_io_s = IOStatus::OK(); assert(num_cfs == static_cast(jobs.size())); -#ifndef ROCKSDB_LITE for (int i = 0; i != num_cfs; ++i) { const MutableCFOptions& mutable_cf_options = all_mutable_cf_options.at(i); // may temporarily unlock and lock the mutex. @@ -494,7 +483,6 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles( NotifyOnFlushBegin(cfds[i], &file_meta[i], mutable_cf_options, job_context->job_id, flush_reason); } -#endif /* !ROCKSDB_LITE */ if (logfile_number_ > 0) { // TODO (yanqin) investigate whether we should sync the closed logs for @@ -703,10 +691,8 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles( mems_list.emplace_back(&mems); mutable_cf_options_list.emplace_back(&all_mutable_cf_options[i]); tmp_file_meta.emplace_back(&file_meta[i]); -#ifndef ROCKSDB_LITE committed_flush_jobs_info.emplace_back( jobs[i]->GetCommittedFlushJobsInfo()); -#endif //! ROCKSDB_LITE } } @@ -758,7 +744,6 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles( if (made_progress) { *made_progress = true; } -#ifndef ROCKSDB_LITE auto sfm = static_cast( immutable_db_options_.sst_file_manager.get()); assert(all_mutable_cf_options.size() == static_cast(num_cfs)); @@ -789,7 +774,6 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles( } } } -#endif // ROCKSDB_LITE } // Need to undo atomic flush if something went wrong, i.e. s is not OK and @@ -827,7 +811,6 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles( void DBImpl::NotifyOnFlushBegin(ColumnFamilyData* cfd, FileMetaData* file_meta, const MutableCFOptions& mutable_cf_options, int job_id, FlushReason flush_reason) { -#ifndef ROCKSDB_LITE if (immutable_db_options_.listeners.size() == 0U) { return; } @@ -867,19 +850,11 @@ void DBImpl::NotifyOnFlushBegin(ColumnFamilyData* cfd, FileMetaData* file_meta, mutex_.Lock(); // no need to signal bg_cv_ as it will be signaled at the end of the // flush process. -#else - (void)cfd; - (void)file_meta; - (void)mutable_cf_options; - (void)job_id; - (void)flush_reason; -#endif // ROCKSDB_LITE } void DBImpl::NotifyOnFlushCompleted( ColumnFamilyData* cfd, const MutableCFOptions& mutable_cf_options, std::list>* flush_jobs_info) { -#ifndef ROCKSDB_LITE assert(flush_jobs_info != nullptr); if (immutable_db_options_.listeners.size() == 0U) { return; @@ -911,11 +886,6 @@ void DBImpl::NotifyOnFlushCompleted( mutex_.Lock(); // no need to signal bg_cv_ as it will be signaled at the end of the // flush process. -#else - (void)cfd; - (void)mutable_cf_options; - (void)flush_jobs_info; -#endif // ROCKSDB_LITE } Status DBImpl::CompactRange(const CompactRangeOptions& options, @@ -1298,17 +1268,6 @@ Status DBImpl::CompactFiles(const CompactionOptions& compact_options, const int output_level, const int output_path_id, std::vector* const output_file_names, CompactionJobInfo* compaction_job_info) { -#ifdef ROCKSDB_LITE - (void)compact_options; - (void)column_family; - (void)input_file_names; - (void)output_level; - (void)output_path_id; - (void)output_file_names; - (void)compaction_job_info; - // not supported in lite version - return Status::NotSupported("Not supported in ROCKSDB LITE"); -#else if (column_family == nullptr) { return Status::InvalidArgument("ColumnFamilyHandle must be non-null."); } @@ -1367,10 +1326,8 @@ Status DBImpl::CompactFiles(const CompactionOptions& compact_options, } return s; -#endif // ROCKSDB_LITE } -#ifndef ROCKSDB_LITE Status DBImpl::CompactFilesImpl( const CompactionOptions& compact_options, ColumnFamilyData* cfd, Version* version, const std::vector& input_file_names, @@ -1512,14 +1469,12 @@ Status DBImpl::CompactFilesImpl( // SetBGError compaction_job.io_status().PermitUncheckedError(); c->ReleaseCompactionFiles(s); -#ifndef ROCKSDB_LITE // Need to make sure SstFileManager does its bookkeeping auto sfm = static_cast( immutable_db_options_.sst_file_manager.get()); if (sfm && sfm_reserved_compact_space) { sfm->OnCompactionCompletion(c.get()); } -#endif // ROCKSDB_LITE ReleaseFileNumberFromPendingOutputs(pending_outputs_inserted_elem); @@ -1576,7 +1531,6 @@ Status DBImpl::CompactFilesImpl( return status; } -#endif // ROCKSDB_LITE Status DBImpl::PauseBackgroundWork() { InstrumentedMutexLock guard_lock(&mutex_); @@ -1610,7 +1564,6 @@ void DBImpl::NotifyOnCompactionBegin(ColumnFamilyData* cfd, Compaction* c, const Status& st, const CompactionJobStats& job_stats, int job_id) { -#ifndef ROCKSDB_LITE if (immutable_db_options_.listeners.empty()) { return; } @@ -1639,19 +1592,11 @@ void DBImpl::NotifyOnCompactionBegin(ColumnFamilyData* cfd, Compaction* c, } mutex_.Lock(); current->Unref(); -#else - (void)cfd; - (void)c; - (void)st; - (void)job_stats; - (void)job_id; -#endif // ROCKSDB_LITE } void DBImpl::NotifyOnCompactionCompleted( ColumnFamilyData* cfd, Compaction* c, const Status& st, const CompactionJobStats& compaction_job_stats, const int job_id) { -#ifndef ROCKSDB_LITE if (immutable_db_options_.listeners.size() == 0U) { return; } @@ -1681,13 +1626,6 @@ void DBImpl::NotifyOnCompactionCompleted( current->Unref(); // no need to signal bg_cv_ as it will be signaled at the end of the // flush process. -#else - (void)cfd; - (void)c; - (void)st; - (void)compaction_job_stats; - (void)job_id; -#endif // ROCKSDB_LITE } // REQUIREMENT: block all background work by calling PauseBackgroundWork() @@ -3590,14 +3528,12 @@ Status DBImpl::BackgroundCompaction(bool* made_progress, c->ReleaseCompactionFiles(status); *made_progress = true; -#ifndef ROCKSDB_LITE // Need to make sure SstFileManager does its bookkeeping auto sfm = static_cast( immutable_db_options_.sst_file_manager.get()); if (sfm && sfm_reserved_compact_space) { sfm->OnCompactionCompletion(c.get()); } -#endif // ROCKSDB_LITE NotifyOnCompactionCompleted(c->column_family_data(), c.get(), status, compaction_job_stats, job_context->job_id); @@ -3774,7 +3710,6 @@ bool DBImpl::MCOverlap(ManualCompactionState* m, ManualCompactionState* m1) { return false; } -#ifndef ROCKSDB_LITE void DBImpl::BuildCompactionJobInfo( const ColumnFamilyData* cfd, Compaction* c, const Status& st, const CompactionJobStats& compaction_job_stats, const int job_id, @@ -3843,7 +3778,6 @@ void DBImpl::BuildCompactionJobInfo( std::move(blob_file_garbage_info)); } } -#endif // SuperVersionContext gets created and destructed outside of the lock -- // we use this conveniently to: diff --git a/db/db_impl/db_impl_debug.cc b/db/db_impl/db_impl_debug.cc index 83c37dced70..9b6685f6221 100644 --- a/db/db_impl/db_impl_debug.cc +++ b/db/db_impl/db_impl_debug.cc @@ -289,7 +289,6 @@ size_t DBImpl::TEST_GetWalPreallocateBlockSize( return GetWalPreallocateBlockSize(write_buffer_size); } -#ifndef ROCKSDB_LITE void DBImpl::TEST_WaitForPeriodicTaskRun(std::function callback) const { periodic_task_scheduler_.TEST_WaitForRun(callback); } @@ -303,7 +302,6 @@ SeqnoToTimeMapping DBImpl::TEST_GetSeqnoToTimeMapping() const { return seqno_time_mapping_; } -#endif // !ROCKSDB_LITE size_t DBImpl::TEST_EstimateInMemoryStatsHistorySize() const { return EstimateInMemoryStatsHistorySize(); diff --git a/db/db_impl/db_impl_experimental.cc b/db/db_impl/db_impl_experimental.cc index 2f732c1e47d..3e43fe498ff 100644 --- a/db/db_impl/db_impl_experimental.cc +++ b/db/db_impl/db_impl_experimental.cc @@ -20,7 +20,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE Status DBImpl::SuggestCompactRange(ColumnFamilyHandle* column_family, const Slice* begin, const Slice* end) { auto cfh = static_cast_with_check(column_family); @@ -154,6 +153,5 @@ Status DBImpl::PromoteL0(ColumnFamilyHandle* column_family, int target_level) { return status; } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_impl/db_impl_files.cc b/db/db_impl/db_impl_files.cc index 9834ff4b27f..b65c8732c2b 100644 --- a/db/db_impl/db_impl_files.cc +++ b/db/db_impl/db_impl_files.cc @@ -599,13 +599,11 @@ void DBImpl::PurgeObsoleteFiles(JobContext& state, bool schedule_only) { to_delete; } -#ifndef ROCKSDB_LITE if (type == kWalFile && (immutable_db_options_.WAL_ttl_seconds > 0 || immutable_db_options_.WAL_size_limit_MB > 0)) { wal_manager_.ArchiveWALFile(fname, number); continue; } -#endif // !ROCKSDB_LITE // If I do not own these files, e.g. secondary instance with max_open_files // = -1, then no need to delete or schedule delete these files since they @@ -669,9 +667,7 @@ void DBImpl::PurgeObsoleteFiles(JobContext& state, bool schedule_only) { } } } -#ifndef ROCKSDB_LITE wal_manager_.PurgeObsoleteWALFiles(); -#endif // ROCKSDB_LITE LogFlush(immutable_db_options_.info_log); InstrumentedMutexLock l(&mutex_); --pending_purge_obsolete_files_; diff --git a/db/db_impl/db_impl_open.cc b/db/db_impl/db_impl_open.cc index 3263e94bce5..510fb189b68 100644 --- a/db/db_impl/db_impl_open.cc +++ b/db/db_impl/db_impl_open.cc @@ -153,7 +153,6 @@ DBOptions SanitizeOptions(const std::string& dbname, const DBOptions& src, result.avoid_flush_during_recovery = false; } -#ifndef ROCKSDB_LITE ImmutableDBOptions immutable_db_options(result); if (!immutable_db_options.IsWalDirSameAsDBPath()) { // Either the WAL dir and db_paths[0]/db_name are not the same, or we @@ -195,7 +194,6 @@ DBOptions SanitizeOptions(const std::string& dbname, const DBOptions& src, NewSstFileManager(result.env, result.info_log)); result.sst_file_manager = sst_file_manager; } -#endif // !ROCKSDB_LITE // Supported wal compression types if (!StreamingCompressionTypeSupported(result.wal_compression)) { @@ -845,7 +843,6 @@ Status DBImpl::LogAndApplyForRecovery(const RecoveryContext& recovery_ctx) { } void DBImpl::InvokeWalFilterIfNeededOnColumnFamilyToWalNumberMap() { -#ifndef ROCKSDB_LITE if (immutable_db_options_.wal_filter == nullptr) { return; } @@ -863,7 +860,6 @@ void DBImpl::InvokeWalFilterIfNeededOnColumnFamilyToWalNumberMap() { } wal_filter.ColumnFamilyLogNumberMap(cf_lognumber_map, cf_name_id_map); -#endif // !ROCKSDB_LITE } bool DBImpl::InvokeWalFilterIfNeededOnWalRecord(uint64_t wal_number, @@ -872,7 +868,6 @@ bool DBImpl::InvokeWalFilterIfNeededOnWalRecord(uint64_t wal_number, Status& status, bool& stop_replay, WriteBatch& batch) { -#ifndef ROCKSDB_LITE if (immutable_db_options_.wal_filter == nullptr) { return true; } @@ -958,15 +953,6 @@ bool DBImpl::InvokeWalFilterIfNeededOnWalRecord(uint64_t wal_number, batch = new_batch; } return true; -#else // !ROCKSDB_LITE - (void)wal_number; - (void)wal_fname; - (void)reporter; - (void)status; - (void)stop_replay; - (void)batch; - return true; -#endif // ROCKSDB_LITE } // REQUIRES: wal_numbers are sorted in ascending order @@ -1981,7 +1967,6 @@ Status DBImpl::Open(const DBOptions& db_options, const std::string& dbname, } impl->mutex_.Unlock(); -#ifndef ROCKSDB_LITE auto sfm = static_cast( impl->immutable_db_options_.sst_file_manager.get()); if (s.ok() && sfm) { @@ -2065,7 +2050,6 @@ Status DBImpl::Open(const DBOptions& db_options, const std::string& dbname, impl->immutable_db_options_.db_paths[0].path); } -#endif // !ROCKSDB_LITE if (s.ok()) { ROCKS_LOG_HEADER(impl->immutable_db_options_.info_log, "DB pointer %p", diff --git a/db/db_impl/db_impl_readonly.cc b/db/db_impl/db_impl_readonly.cc index 0f10baf2497..13bc37edb9f 100644 --- a/db/db_impl/db_impl_readonly.cc +++ b/db/db_impl/db_impl_readonly.cc @@ -16,7 +16,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE DBImplReadOnly::DBImplReadOnly(const DBOptions& db_options, const std::string& dbname) @@ -321,21 +320,5 @@ Status DBImplReadOnly::OpenForReadOnlyWithoutCheck( return s; } -#else // !ROCKSDB_LITE - -Status DB::OpenForReadOnly(const Options& /*options*/, - const std::string& /*dbname*/, DB** /*dbptr*/, - bool /*error_if_wal_file_exists*/) { - return Status::NotSupported("Not supported in ROCKSDB_LITE."); -} - -Status DB::OpenForReadOnly( - const DBOptions& /*db_options*/, const std::string& /*dbname*/, - const std::vector& /*column_families*/, - std::vector* /*handles*/, DB** /*dbptr*/, - bool /*error_if_wal_file_exists*/) { - return Status::NotSupported("Not supported in ROCKSDB_LITE."); -} -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_impl/db_impl_readonly.h b/db/db_impl/db_impl_readonly.h index b876a0fdaf0..1cc37419814 100644 --- a/db/db_impl/db_impl_readonly.h +++ b/db/db_impl/db_impl_readonly.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -146,12 +145,10 @@ class DBImplReadOnly : public DBImpl { // FIXME: some missing overrides for more "write" functions protected: -#ifndef ROCKSDB_LITE Status FlushForGetLiveFiles() override { // No-op for read-only DB return Status::OK(); } -#endif // !ROCKSDB_LITE private: // A "helper" function for DB::OpenForReadOnly without column families @@ -167,4 +164,3 @@ class DBImplReadOnly : public DBImpl { }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/db_impl/db_impl_secondary.cc b/db/db_impl/db_impl_secondary.cc index 5189d17d984..f4ee4afbc1f 100644 --- a/db/db_impl/db_impl_secondary.cc +++ b/db/db_impl/db_impl_secondary.cc @@ -17,7 +17,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE DBImplSecondary::DBImplSecondary(const DBOptions& db_options, const std::string& dbname, std::string secondary_path) @@ -946,22 +945,5 @@ Status DB::OpenAndCompact( output, override_options); } -#else // !ROCKSDB_LITE - -Status DB::OpenAsSecondary(const Options& /*options*/, - const std::string& /*name*/, - const std::string& /*secondary_path*/, - DB** /*dbptr*/) { - return Status::NotSupported("Not supported in ROCKSDB_LITE."); -} - -Status DB::OpenAsSecondary( - const DBOptions& /*db_options*/, const std::string& /*dbname*/, - const std::string& /*secondary_path*/, - const std::vector& /*column_families*/, - std::vector* /*handles*/, DB** /*dbptr*/) { - return Status::NotSupported("Not supported in ROCKSDB_LITE."); -} -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_impl/db_impl_secondary.h b/db/db_impl/db_impl_secondary.h index eb93618752c..3c219862211 100644 --- a/db/db_impl/db_impl_secondary.h +++ b/db/db_impl/db_impl_secondary.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -269,12 +268,10 @@ class DBImplSecondary : public DBImpl { #endif // NDEBUG protected: -#ifndef ROCKSDB_LITE Status FlushForGetLiveFiles() override { // No-op for read-only DB return Status::OK(); } -#endif // !ROCKSDB_LITE // ColumnFamilyCollector is a write batch handler which does nothing // except recording unique column family IDs @@ -407,4 +404,3 @@ class DBImplSecondary : public DBImpl { } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/db_impl/db_impl_write.cc b/db/db_impl/db_impl_write.cc index ee8c9898931..15829ccd822 100644 --- a/db/db_impl/db_impl_write.cc +++ b/db/db_impl/db_impl_write.cc @@ -149,7 +149,6 @@ Status DBImpl::Write(const WriteOptions& write_options, WriteBatch* my_batch) { return s; } -#ifndef ROCKSDB_LITE Status DBImpl::WriteWithCallback(const WriteOptions& write_options, WriteBatch* my_batch, WriteCallback* callback) { @@ -163,7 +162,6 @@ Status DBImpl::WriteWithCallback(const WriteOptions& write_options, } return s; } -#endif // ROCKSDB_LITE // The main write queue. This is the only write queue that updates LastSequence. // When using one write queue, the same sequence also indicates the last @@ -2032,7 +2030,6 @@ Status DBImpl::ScheduleFlushes(WriteContext* context) { return status; } -#ifndef ROCKSDB_LITE void DBImpl::NotifyOnMemTableSealed(ColumnFamilyData* /*cfd*/, const MemTableInfo& mem_table_info) { if (immutable_db_options_.listeners.size() == 0U) { @@ -2048,7 +2045,6 @@ void DBImpl::NotifyOnMemTableSealed(ColumnFamilyData* /*cfd*/, } mutex_.Lock(); } -#endif // ROCKSDB_LITE // REQUIRES: mutex_ is held // REQUIRES: this thread is currently at the front of the writer queue @@ -2087,14 +2083,12 @@ Status DBImpl::SwitchMemtable(ColumnFamilyData* cfd, WriteContext* context) { const MutableCFOptions mutable_cf_options = *cfd->GetLatestMutableCFOptions(); // Set memtable_info for memtable sealed callback -#ifndef ROCKSDB_LITE MemTableInfo memtable_info; memtable_info.cf_name = cfd->GetName(); memtable_info.first_seqno = cfd->mem()->GetFirstSequenceNumber(); memtable_info.earliest_seqno = cfd->mem()->GetEarliestSequenceNumber(); memtable_info.num_entries = cfd->mem()->num_entries(); memtable_info.num_deletes = cfd->mem()->num_deletes(); -#endif // ROCKSDB_LITE // Log this later after lock release. It may be outdated, e.g., if background // flush happens before logging, but that should be ok. int num_imm_unflushed = cfd->imm()->NumNotFlushed(); @@ -2253,11 +2247,9 @@ Status DBImpl::SwitchMemtable(ColumnFamilyData* cfd, WriteContext* context) { InstallSuperVersionAndScheduleWork(cfd, &context->superversion_context, mutable_cf_options); -#ifndef ROCKSDB_LITE // Notify client that memtable is sealed, now that we have successfully // installed a new memtable NotifyOnMemTableSealed(cfd, memtable_info); -#endif // ROCKSDB_LITE // It is possible that we got here without checking the value of i_os, but // that is okay. If we did, it most likely means that s was already an error. // In any case, ignore any unchecked error for i_os here. diff --git a/db/db_io_failure_test.cc b/db/db_io_failure_test.cc index 2a405fd38d4..e79272ea7ec 100644 --- a/db/db_io_failure_test.cc +++ b/db/db_io_failure_test.cc @@ -19,7 +19,6 @@ class DBIOFailureTest : public DBTestBase { DBIOFailureTest() : DBTestBase("db_io_failure_test", /*env_do_fsync=*/true) {} }; -#ifndef ROCKSDB_LITE // Check that number of files does not grow when writes are dropped TEST_F(DBIOFailureTest, DropWrites) { do { @@ -123,7 +122,6 @@ TEST_F(DBIOFailureTest, NoSpaceCompactRange) { env_->no_space_.store(false, std::memory_order_release); } while (ChangeCompactOptions()); } -#endif // ROCKSDB_LITE TEST_F(DBIOFailureTest, NonWritableFileSystem) { do { @@ -147,7 +145,6 @@ TEST_F(DBIOFailureTest, NonWritableFileSystem) { } while (ChangeCompactOptions()); } -#ifndef ROCKSDB_LITE TEST_F(DBIOFailureTest, ManifestWriteError) { // Test for the following problem: // (a) Compaction produces file F @@ -582,7 +579,6 @@ TEST_F(DBIOFailureTest, CompactionSstSyncError) { ASSERT_EQ("bar3", Get(1, "foo")); } #endif // !(defined NDEBUG) || !defined(OS_WIN) -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/db/db_iter.cc b/db/db_iter.cc index 1e4a735dca4..83f52a0ccf9 100644 --- a/db/db_iter.cc +++ b/db/db_iter.cc @@ -1439,7 +1439,6 @@ void DBIter::Seek(const Slice& target) { PERF_CPU_TIMER_GUARD(iter_seek_cpu_nanos, clock_); StopWatch sw(clock_, statistics_, DB_SEEK); -#ifndef ROCKSDB_LITE if (db_impl_ != nullptr && cfd_ != nullptr) { // TODO: What do we do if this returns an error? Slice lower_bound, upper_bound; @@ -1456,7 +1455,6 @@ void DBIter::Seek(const Slice& target) { db_impl_->TraceIteratorSeek(cfd_->GetID(), target, lower_bound, upper_bound) .PermitUncheckedError(); } -#endif // ROCKSDB_LITE status_ = Status::OK(); ReleaseTempPinnedData(); @@ -1514,7 +1512,6 @@ void DBIter::SeekForPrev(const Slice& target) { PERF_CPU_TIMER_GUARD(iter_seek_cpu_nanos, clock_); StopWatch sw(clock_, statistics_, DB_SEEK); -#ifndef ROCKSDB_LITE if (db_impl_ != nullptr && cfd_ != nullptr) { // TODO: What do we do if this returns an error? Slice lower_bound, upper_bound; @@ -1533,7 +1530,6 @@ void DBIter::SeekForPrev(const Slice& target) { upper_bound) .PermitUncheckedError(); } -#endif // ROCKSDB_LITE status_ = Status::OK(); ReleaseTempPinnedData(); diff --git a/db/db_iter.h b/db/db_iter.h index e87c2b4c90e..0fb766fd202 100644 --- a/db/db_iter.h +++ b/db/db_iter.h @@ -388,13 +388,7 @@ class DBIter final : public Iterator { MergeContext merge_context_; LocalStatistics local_stats_; PinnedIteratorsManager pinned_iters_mgr_; -#ifdef ROCKSDB_LITE - ROCKSDB_FIELD_UNUSED -#endif DBImpl* db_impl_; -#ifdef ROCKSDB_LITE - ROCKSDB_FIELD_UNUSED -#endif ColumnFamilyData* cfd_; const Slice* const timestamp_ub_; const Slice* const timestamp_lb_; diff --git a/db/db_iterator_test.cc b/db/db_iterator_test.cc index 33681322191..f9e026a8c3e 100644 --- a/db/db_iterator_test.cc +++ b/db/db_iterator_test.cc @@ -891,7 +891,6 @@ TEST_P(DBIteratorTest, IteratorDeleteAfterCfDrop) { } // SetOptions not defined in ROCKSDB LITE -#ifndef ROCKSDB_LITE TEST_P(DBIteratorTest, DBIteratorBoundTest) { Options options = CurrentOptions(); options.env = env_; @@ -1119,7 +1118,6 @@ TEST_P(DBIteratorTest, DBIteratorBoundMultiSeek) { TestGetTickerCount(options, BLOCK_CACHE_MISS)); } } -#endif TEST_P(DBIteratorTest, DBIteratorBoundOptimizationTest) { for (auto format_version : {2, 3, 4}) { @@ -1564,7 +1562,6 @@ INSTANTIATE_TEST_CASE_P(DBIteratorTestForPinnedDataInstance, DBIteratorTestForPinnedData, testing::Values(true, false)); -#ifndef ROCKSDB_LITE TEST_P(DBIteratorTest, PinnedDataIteratorMultipleFiles) { Options options = CurrentOptions(); BlockBasedTableOptions table_options; @@ -1634,7 +1631,6 @@ TEST_P(DBIteratorTest, PinnedDataIteratorMultipleFiles) { delete iter; } -#endif TEST_P(DBIteratorTest, PinnedDataIteratorMergeOperator) { Options options = CurrentOptions(); @@ -2216,9 +2212,7 @@ TEST_P(DBIteratorTest, ReadAhead) { ASSERT_OK(Put(Key(i), value)); } ASSERT_OK(Flush()); -#ifndef ROCKSDB_LITE ASSERT_EQ("1,1,1", FilesPerLevel()); -#endif // !ROCKSDB_LITE env_->random_read_bytes_counter_ = 0; options.statistics->setTickerCount(NO_FILE_OPENS, 0); @@ -2281,12 +2275,10 @@ TEST_P(DBIteratorTest, DBIteratorSkipRecentDuplicatesTest) { ASSERT_OK(Put("b", std::to_string(i + 1).c_str())); } -#ifndef ROCKSDB_LITE // Check that memtable wasn't flushed. std::string val; ASSERT_TRUE(db_->GetProperty("rocksdb.num-files-at-level0", &val)); EXPECT_EQ("0", val); -#endif // Seek iterator to a smaller key. get_perf_context()->Reset(); diff --git a/db/db_log_iter_test.cc b/db/db_log_iter_test.cc index 4e982858c4c..4c9434586e3 100644 --- a/db/db_log_iter_test.cc +++ b/db/db_log_iter_test.cc @@ -10,7 +10,6 @@ // Introduction of SyncPoint effectively disabled building and running this test // in Release build. // which is a pity, it is a good test -#if !defined(ROCKSDB_LITE) #include "db/db_test_util.h" #include "env/mock_env.h" @@ -290,16 +289,9 @@ TEST_F(DBTestXactLogIterator, TransactionLogIteratorBlobs) { } } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) int main(int argc, char** argv) { -#if !defined(ROCKSDB_LITE) ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -#else - (void)argc; - (void)argv; - return 0; -#endif } diff --git a/db/db_logical_block_size_cache_test.cc b/db/db_logical_block_size_cache_test.cc index 13c16618e6b..ff56d56e370 100644 --- a/db/db_logical_block_size_cache_test.cc +++ b/db/db_logical_block_size_cache_test.cc @@ -72,12 +72,8 @@ TEST_F(DBLogicalBlockSizeCacheTest, OpenClose) { printf("Open\n"); ASSERT_OK(DB::Open(options, dbname_, &db)); } else { -#ifdef ROCKSDB_LITE - break; -#else printf("OpenForReadOnly\n"); ASSERT_OK(DB::OpenForReadOnly(options, dbname_, &db)); -#endif } ASSERT_EQ(2, cache_->Size()); ASSERT_TRUE(cache_->Contains(data_path_0_)); @@ -104,12 +100,8 @@ TEST_F(DBLogicalBlockSizeCacheTest, OpenDelete) { printf("Open\n"); ASSERT_OK(DB::Open(options, dbname_, &db)); } else { -#ifdef ROCKSDB_LITE - break; -#else printf("OpenForReadOnly\n"); ASSERT_OK(DB::OpenForReadOnly(options, dbname_, &db)); -#endif } ASSERT_EQ(1, cache_->Size()); ASSERT_TRUE(cache_->Contains(dbname_)); @@ -261,16 +253,12 @@ TEST_F(DBLogicalBlockSizeCacheTest, OpenWithColumnFamilies) { {"default", ColumnFamilyOptions()}}, &cfs, &db)); } else { -#ifdef ROCKSDB_LITE - break; -#else printf("OpenForReadOnly\n"); ASSERT_OK(DB::OpenForReadOnly(options, dbname_, {{"cf1", cf_options}, {"cf2", cf_options}, {"default", ColumnFamilyOptions()}}, &cfs, &db)); -#endif } // Logical block sizes of dbname_ and cf_path_0_ are cached during Open. @@ -360,14 +348,10 @@ TEST_F(DBLogicalBlockSizeCacheTest, DestroyColumnFamilyHandle) { options, dbname_, {{"cf", cf_options}, {"default", ColumnFamilyOptions()}}, &cfs, &db)); } else { -#ifdef ROCKSDB_LITE - break; -#else printf("OpenForReadOnly\n"); ASSERT_OK(DB::OpenForReadOnly( options, dbname_, {{"cf", cf_options}, {"default", ColumnFamilyOptions()}}, &cfs, &db)); -#endif } // cf_path_0_ and dbname_ are cached. ASSERT_EQ(2, cache_->Size()); diff --git a/db/db_merge_operand_test.cc b/db/db_merge_operand_test.cc index 629d3923f63..774ae4a9605 100644 --- a/db/db_merge_operand_test.cc +++ b/db/db_merge_operand_test.cc @@ -8,9 +8,7 @@ #include "rocksdb/perf_context.h" #include "rocksdb/utilities/debug.h" #include "table/block_based/block_builder.h" -#if !defined(ROCKSDB_LITE) #include "test_util/sync_point.h" -#endif #include "rocksdb/merge_operator.h" #include "utilities/fault_injection_env.h" #include "utilities/merge_operators.h" diff --git a/db/db_merge_operator_test.cc b/db/db_merge_operator_test.cc index f8c90c15871..f3a8b8cb923 100644 --- a/db/db_merge_operator_test.cc +++ b/db/db_merge_operator_test.cc @@ -202,7 +202,6 @@ TEST_F(DBMergeOperatorTest, MergeErrorOnIteration) { VerifyDBInternal({{"k1", "v1"}, {"k2", "corrupted"}, {"k2", "v2"}}); } -#ifndef ROCKSDB_LITE TEST_F(DBMergeOperatorTest, MergeOperatorFailsWithMustMerge) { // This is like a mini-stress test dedicated to `OpFailureScope::kMustMerge`. @@ -355,7 +354,6 @@ TEST_F(DBMergeOperatorTest, MergeOperatorFailsWithMustMerge) { } } -#endif // ROCKSDB_LITE class MergeOperatorPinningTest : public DBMergeOperatorTest, public testing::WithParamInterface { @@ -368,7 +366,6 @@ class MergeOperatorPinningTest : public DBMergeOperatorTest, INSTANTIATE_TEST_CASE_P(MergeOperatorPinningTest, MergeOperatorPinningTest, ::testing::Bool()); -#ifndef ROCKSDB_LITE TEST_P(MergeOperatorPinningTest, OperandsMultiBlocks) { Options options = CurrentOptions(); BlockBasedTableOptions table_options; @@ -639,7 +636,6 @@ TEST_F(DBMergeOperatorTest, TailingIteratorMemtableUnrefedBySomeoneElse) { EXPECT_TRUE(pushed_first_operand); EXPECT_TRUE(stepped_to_next_operand); } -#endif // ROCKSDB_LITE TEST_F(DBMergeOperatorTest, SnapshotCheckerAndReadCallback) { Options options = CurrentOptions(); diff --git a/db/db_options_test.cc b/db/db_options_test.cc index 691081db9db..3304c63393b 100644 --- a/db/db_options_test.cc +++ b/db/db_options_test.cc @@ -29,7 +29,6 @@ class DBOptionsTest : public DBTestBase { public: DBOptionsTest() : DBTestBase("db_options_test", /*env_do_fsync=*/true) {} -#ifndef ROCKSDB_LITE std::unordered_map GetMutableDBOptionsMap( const DBOptions& options) { std::string options_str; @@ -76,7 +75,6 @@ class DBOptionsTest : public DBTestBase { auto sanitized_options = SanitizeOptions(dbname_, db_options); return GetMutableDBOptionsMap(sanitized_options); } -#endif // ROCKSDB_LITE }; TEST_F(DBOptionsTest, ImmutableTrackAndVerifyWalsInManifest) { @@ -112,7 +110,6 @@ TEST_F(DBOptionsTest, ImmutableVerifySstUniqueIdInManifest) { } // RocksDB lite don't support dynamic options. -#ifndef ROCKSDB_LITE TEST_F(DBOptionsTest, AvoidUpdatingOptions) { Options options; @@ -1148,7 +1145,6 @@ TEST_F(DBOptionsTest, ChangeCompression) { SyncPoint::GetInstance()->DisableProcessing(); } -#endif // ROCKSDB_LITE TEST_F(DBOptionsTest, BottommostCompressionOptsWithFallbackType) { // Verify the bottommost compression options still take effect even when the diff --git a/db/db_properties_test.cc b/db/db_properties_test.cc index cbc55c97201..de63def829b 100644 --- a/db/db_properties_test.cc +++ b/db/db_properties_test.cc @@ -55,7 +55,6 @@ class DBPropertiesTest : public DBTestBase { } }; -#ifndef ROCKSDB_LITE TEST_F(DBPropertiesTest, Empty) { do { Options options; @@ -1112,7 +1111,6 @@ TEST_F(DBPropertiesTest, EstimateCompressionRatio) { ASSERT_GT(CompressionRatioAtLevel(1), 10.0); } -#endif // ROCKSDB_LITE class CountingUserTblPropCollector : public TablePropertiesCollector { public: @@ -1263,7 +1261,6 @@ class BlockCountingTablePropertiesCollectorFactory } }; -#ifndef ROCKSDB_LITE TEST_F(DBPropertiesTest, GetUserDefinedTableProperties) { Options options = CurrentOptions(); options.level0_file_num_compaction_trigger = (1 << 30); @@ -1303,7 +1300,6 @@ TEST_F(DBPropertiesTest, GetUserDefinedTableProperties) { ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr)); ASSERT_GT(collector_factory->num_created_, 0U); } -#endif // ROCKSDB_LITE TEST_F(DBPropertiesTest, UserDefinedTablePropertiesContext) { Options options = CurrentOptions(); @@ -1365,7 +1361,6 @@ TEST_F(DBPropertiesTest, UserDefinedTablePropertiesContext) { ASSERT_GT(collector_factory->num_created_, 0U); } -#ifndef ROCKSDB_LITE TEST_F(DBPropertiesTest, TablePropertiesNeedCompactTest) { Random rnd(301); @@ -2195,7 +2190,6 @@ TEST_F(DBPropertiesTest, TableMetaIndexKeys) { } while (ChangeOptions()); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_range_del_test.cc b/db/db_range_del_test.cc index bfabc42fb67..44f7da17a33 100644 --- a/db/db_range_del_test.cc +++ b/db/db_range_del_test.cc @@ -27,9 +27,6 @@ class DBRangeDelTest : public DBTestBase { } }; -// PlainTableFactory, WriteBatchWithIndex, and NumTableFilesAtLevel() are not -// supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(DBRangeDelTest, NonBlockBasedTableNotSupported) { // TODO: figure out why MmapReads trips the iterator pinning assertion in // RangeDelAggregator. Ideally it would be supported; otherwise it should at @@ -298,7 +295,6 @@ TEST_F(DBRangeDelTest, CompactRangeDelsSameStartKey) { ASSERT_TRUE(db_->Get(ReadOptions(), "b1", &value).IsNotFound()); } } -#endif // ROCKSDB_LITE TEST_F(DBRangeDelTest, FlushRemovesCoveredKeys) { const int kNum = 300, kRangeBegin = 50, kRangeEnd = 250; @@ -335,8 +331,6 @@ TEST_F(DBRangeDelTest, FlushRemovesCoveredKeys) { db_->ReleaseSnapshot(snapshot); } -// NumTableFilesAtLevel() is not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(DBRangeDelTest, CompactionRemovesCoveredKeys) { const int kNumPerFile = 100, kNumFiles = 4; Options opts = CurrentOptions(); @@ -517,7 +511,6 @@ TEST_F(DBRangeDelTest, ValidUniversalSubcompactionBoundaries) { std::numeric_limits::max() /* max_file_num_to_ignore */, "" /*trim_ts*/)); } -#endif // ROCKSDB_LITE TEST_F(DBRangeDelTest, CompactionRemovesCoveredMergeOperands) { const int kNumPerFile = 3, kNumFiles = 3; @@ -589,8 +582,6 @@ TEST_F(DBRangeDelTest, PutDeleteRangeMergeFlush) { ASSERT_EQ(expected, actual); } -// NumTableFilesAtLevel() is not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(DBRangeDelTest, ObsoleteTombstoneCleanup) { // During compaction to bottommost level, verify range tombstones older than // the oldest snapshot are removed, while others are preserved. @@ -3024,7 +3015,6 @@ TEST_F(DBRangeDelTest, DoubleCountRangeTombstoneCompensatedSize) { db_->ReleaseSnapshot(snapshot); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_rate_limiter_test.cc b/db/db_rate_limiter_test.cc index e44cc047dcd..acea673cb27 100644 --- a/db/db_rate_limiter_test.cc +++ b/db/db_rate_limiter_test.cc @@ -96,19 +96,10 @@ std::string GetTestNameSuffix( return oss.str(); } -#ifndef ROCKSDB_LITE INSTANTIATE_TEST_CASE_P(DBRateLimiterOnReadTest, DBRateLimiterOnReadTest, ::testing::Combine(::testing::Bool(), ::testing::Bool(), ::testing::Bool()), GetTestNameSuffix); -#else // ROCKSDB_LITE -// Cannot use direct I/O in lite mode. -INSTANTIATE_TEST_CASE_P(DBRateLimiterOnReadTest, DBRateLimiterOnReadTest, - ::testing::Combine(::testing::Values(false), - ::testing::Bool(), - ::testing::Bool()), - GetTestNameSuffix); -#endif // ROCKSDB_LITE TEST_P(DBRateLimiterOnReadTest, Get) { if (use_direct_io_ && !IsDirectIOSupported()) { @@ -234,7 +225,6 @@ TEST_P(DBRateLimiterOnReadTest, Iterator) { ASSERT_EQ(expected, options_.rate_limiter->GetTotalRequests(Env::IO_USER)); } -#if !defined(ROCKSDB_LITE) TEST_P(DBRateLimiterOnReadTest, VerifyChecksum) { if (use_direct_io_ && !IsDirectIOSupported()) { @@ -264,7 +254,6 @@ TEST_P(DBRateLimiterOnReadTest, VerifyFileChecksums) { ASSERT_EQ(expected, options_.rate_limiter->GetTotalRequests(Env::IO_USER)); } -#endif // !defined(ROCKSDB_LITE) class DBRateLimiterOnWriteTest : public DBTestBase { public: @@ -319,10 +308,8 @@ TEST_F(DBRateLimiterOnWriteTest, Compact) { // Pre-comaction: // level-0 : `kNumFiles` SST files overlapping on [kStartKey, kEndKey] -#ifndef ROCKSDB_LITE std::string files_per_level_pre_compaction = std::to_string(kNumFiles); ASSERT_EQ(files_per_level_pre_compaction, FilesPerLevel(0 /* cf */)); -#endif // !ROCKSDB_LITE std::int64_t prev_total_request = options_.rate_limiter->GetTotalRequests(Env::IO_TOTAL); @@ -337,10 +324,8 @@ TEST_F(DBRateLimiterOnWriteTest, Compact) { // Post-comaction: // level-0 : 0 SST file // level-1 : 1 SST file -#ifndef ROCKSDB_LITE std::string files_per_level_post_compaction = "0,1"; ASSERT_EQ(files_per_level_post_compaction, FilesPerLevel(0 /* cf */)); -#endif // !ROCKSDB_LITE std::int64_t exepcted_compaction_request = 1; EXPECT_EQ(actual_compaction_request, exepcted_compaction_request); diff --git a/db/db_readonly_with_timestamp_test.cc b/db/db_readonly_with_timestamp_test.cc index 3f53e780632..675e4943baf 100644 --- a/db/db_readonly_with_timestamp_test.cc +++ b/db/db_readonly_with_timestamp_test.cc @@ -17,7 +17,6 @@ class DBReadOnlyTestWithTimestamp : public DBBasicTestWithTimestampBase { : DBBasicTestWithTimestampBase("db_readonly_test_with_timestamp") {} protected: -#ifndef ROCKSDB_LITE void CheckDBOpenedAsCompactedDBWithOneLevel0File() { VersionSet* const versions = dbfull()->GetVersionSet(); ASSERT_NE(versions, nullptr); @@ -63,10 +62,8 @@ class DBReadOnlyTestWithTimestamp : public DBBasicTestWithTimestampBase { ASSERT_TRUE( storage_info->LevelFilesBrief(highest_non_empty_level).num_files > 0); } -#endif // !ROCKSDB_LITE }; -#ifndef ROCKSDB_LITE TEST_F(DBReadOnlyTestWithTimestamp, IteratorAndGetReadTimestampSizeMismatch) { const int kNumKeysPerFile = 128; const uint64_t kMaxKey = 1024; @@ -949,7 +946,6 @@ TEST_F(DBReadOnlyTestWithTimestamp, Close(); } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/db/db_secondary_test.cc b/db/db_secondary_test.cc index 20d7534e057..f3f0a8d0546 100644 --- a/db/db_secondary_test.cc +++ b/db/db_secondary_test.cc @@ -18,7 +18,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE class DBSecondaryTestBase : public DBBasicTestWithTimestampBase { public: explicit DBSecondaryTestBase(const std::string& dbname) @@ -1682,7 +1681,6 @@ TEST_F(DBSecondaryTestWithTimestamp, Iterators) { Close(); } -#endif //! ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_sst_test.cc b/db/db_sst_test.cc index 7f031444a4c..11e7f49fabd 100644 --- a/db/db_sst_test.cc +++ b/db/db_sst_test.cc @@ -24,7 +24,6 @@ class DBSSTTest : public DBTestBase { DBSSTTest() : DBTestBase("db_sst_test", /*env_do_fsync=*/true) {} }; -#ifndef ROCKSDB_LITE // A class which remembers the name of each flushed file. class FlushedFileCollector : public EventListener { public: @@ -53,7 +52,6 @@ class FlushedFileCollector : public EventListener { std::vector flushed_files_; std::mutex mutex_; }; -#endif // ROCKSDB_LITE TEST_F(DBSSTTest, DontDeletePendingOutputs) { Options options; @@ -151,7 +149,6 @@ TEST_F(DBSSTTest, SkipCheckingSSTFileSizesOnDBOpen) { ASSERT_EQ("choo", Get("pika")); } -#ifndef ROCKSDB_LITE TEST_F(DBSSTTest, DontDeleteMovedFile) { // This test triggers move compaction and verifies that the file is not // deleted when it's part of move compaction @@ -1856,7 +1853,6 @@ TEST_F(DBSSTTest, DBWithSFMForBlobFilesAtomicFlush) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_statistics_test.cc b/db/db_statistics_test.cc index 4d46553611c..85a54aa9487 100644 --- a/db/db_statistics_test.cc +++ b/db/db_statistics_test.cc @@ -157,7 +157,6 @@ TEST_F(DBStatisticsTest, ExcludeTickers) { ASSERT_GT(options.statistics->getTickerCount(BYTES_READ), 0); } -#ifndef ROCKSDB_LITE TEST_F(DBStatisticsTest, VerifyChecksumReadStat) { Options options = CurrentOptions(); @@ -204,7 +203,6 @@ TEST_F(DBStatisticsTest, VerifyChecksumReadStat) { } } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_table_properties_test.cc b/db/db_table_properties_test.cc index 981a514ad8f..7be05e93c9a 100644 --- a/db/db_table_properties_test.cc +++ b/db/db_table_properties_test.cc @@ -24,7 +24,6 @@ #include "test_util/testutil.h" #include "util/random.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { @@ -616,7 +615,6 @@ INSTANTIATE_TEST_CASE_P(DBTablePropertiesTest, DBTablePropertiesTest, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE int main(int argc, char** argv) { ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); diff --git a/db/db_tailing_iter_test.cc b/db/db_tailing_iter_test.cc index 6f22b7b715f..964e06eb3ea 100644 --- a/db/db_tailing_iter_test.cc +++ b/db/db_tailing_iter_test.cc @@ -10,7 +10,6 @@ // Introduction of SyncPoint effectively disabled building and running this test // in Release build. // which is a pity, it is a good test -#if !defined(ROCKSDB_LITE) #include "db/db_test_util.h" #include "db/forward_iterator.h" @@ -588,16 +587,9 @@ TEST_P(DBTestTailingIterator, SeekToFirstWithUpperBoundBug) { } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) int main(int argc, char** argv) { -#if !defined(ROCKSDB_LITE) ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -#else - (void)argc; - (void)argv; - return 0; -#endif } diff --git a/db/db_test.cc b/db/db_test.cc index 1688745c177..05ee14fe2bc 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -129,8 +129,6 @@ TEST_F(DBTest, MockEnvTest) { ASSERT_TRUE(!iterator->Valid()); delete iterator; -// TEST_FlushMemTable() is not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE DBImpl* dbi = static_cast_with_check(db); ASSERT_OK(dbi->TEST_FlushMemTable()); @@ -139,14 +137,10 @@ TEST_F(DBTest, MockEnvTest) { ASSERT_OK(db->Get(ReadOptions(), keys[i], &res)); ASSERT_TRUE(res == vals[i]); } -#endif // ROCKSDB_LITE delete db; } -// NewMemEnv returns nullptr in ROCKSDB_LITE since class InMemoryEnv isn't -// defined. -#ifndef ROCKSDB_LITE TEST_F(DBTest, MemEnvTest) { std::unique_ptr env{NewMemEnv(Env::Default())}; Options options; @@ -199,7 +193,6 @@ TEST_F(DBTest, MemEnvTest) { } delete db; } -#endif // ROCKSDB_LITE TEST_F(DBTest, WriteEmptyBatch) { Options options = CurrentOptions(); @@ -458,7 +451,6 @@ TEST_F(DBTest, MixedSlowdownOptionsStop) { wo.no_slowdown = true; ASSERT_OK(dbfull()->Put(wo, "foo3", "bar")); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, LevelLimitReopen) { Options options = CurrentOptions(); @@ -481,9 +473,7 @@ TEST_F(DBTest, LevelLimitReopen) { options.max_bytes_for_level_multiplier_additional.resize(10, 1); ASSERT_OK(TryReopenWithColumnFamilies({"default", "pikachu"}, options)); } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(DBTest, LevelReopenWithFIFO) { const int kLevelCount = 4; const int kKeyCount = 5; @@ -610,7 +600,6 @@ TEST_F(DBTest, LevelReopenWithFIFO) { ASSERT_EQ(expected_files_per_level_after_fifo[i], FilesPerLevel(kCF)); } } -#endif // !ROCKSDB_LITE TEST_F(DBTest, PutSingleDeleteGet) { do { @@ -857,9 +846,7 @@ TEST_F(DBTest, DISABLED_VeryLargeValue) { ASSERT_OK(Put(key2, raw)); dbfull()->TEST_WaitForFlushMemTable(); -#ifndef ROCKSDB_LITE ASSERT_EQ(1, NumTableFilesAtLevel(0)); -#endif // !ROCKSDB_LITE std::string value; Status s = db_->Get(ReadOptions(), key1, &value); @@ -936,7 +923,6 @@ TEST_F(DBTest, WrongLevel0Config) { ASSERT_OK(DB::Open(options, dbname_, &db_)); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, GetOrderedByLevels) { do { CreateAndReopenWithCF({"pikachu"}, CurrentOptions()); @@ -1007,7 +993,6 @@ TEST_F(DBTest, GetEncountersEmptyLevel) { ASSERT_EQ(NumTableFilesAtLevel(0, 1), 1); // XXX } while (ChangeOptions(kSkipUniversalCompaction | kSkipFIFOCompaction)); } -#endif // ROCKSDB_LITE TEST_F(DBTest, FlushMultipleMemtable) { do { @@ -1027,7 +1012,6 @@ TEST_F(DBTest, FlushMultipleMemtable) { ASSERT_OK(Flush(1)); } while (ChangeCompactOptions()); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, FlushSchedule) { Options options = CurrentOptions(); options.disable_auto_compactions = true; @@ -1072,7 +1056,6 @@ TEST_F(DBTest, FlushSchedule) { ASSERT_LE(pikachu_tables, static_cast(10)); ASSERT_GT(pikachu_tables, static_cast(0)); } -#endif // ROCKSDB_LITE namespace { class KeepFilter : public CompactionFilter { @@ -1137,14 +1120,12 @@ class DelayFilterFactory : public CompactionFilterFactory { }; } // anonymous namespace -#ifndef ROCKSDB_LITE static std::string CompressibleString(Random* rnd, int len) { std::string r; test::CompressibleString(rnd, 0.8, len, &r); return r; } -#endif // ROCKSDB_LITE TEST_F(DBTest, FailMoreDbPaths) { Options options = CurrentOptions(); @@ -1266,7 +1247,6 @@ void CheckLiveFilesMeta( } } -#ifndef ROCKSDB_LITE void AddBlobFile(const ColumnFamilyHandle* cfh, uint64_t blob_file_number, uint64_t total_blob_count, uint64_t total_blob_bytes, const std::string& checksum_method, @@ -1558,9 +1538,7 @@ TEST_F(DBTest, DISABLED_RepeatedWritesToSameKey) { } } while (ChangeCompactOptions()); } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE static bool Between(uint64_t val, uint64_t low, uint64_t high) { bool result = (val >= low) && (val <= high); if (!result) { @@ -1957,9 +1935,7 @@ TEST_F(DBTest, ApproximateSizes_MixOfSmallAndLarge) { // ApproximateOffsetOf() is not yet implemented in plain table format. } while (ChangeOptions(kSkipPlainTable)); } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(DBTest, Snapshot) { env_->SetMockSleep(); anon::OptionsOverride options_override; @@ -2081,7 +2057,6 @@ TEST_F(DBTest, HiddenValuesAreRemoved) { } while (ChangeOptions(kSkipUniversalCompaction | kSkipFIFOCompaction | kSkipPlainTable)); } -#endif // ROCKSDB_LITE TEST_F(DBTest, UnremovableSingleDelete) { // If we compact: @@ -2132,7 +2107,6 @@ TEST_F(DBTest, UnremovableSingleDelete) { kSkipMergePut)); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, DeletionMarkers1) { Options options = CurrentOptions(); CreateAndReopenWithCF({"pikachu"}, options); @@ -2252,7 +2226,6 @@ TEST_F(DBTest, OverlapInLevel0) { ASSERT_EQ("NOT_FOUND", Get(1, "600")); } while (ChangeOptions(kSkipUniversalCompaction | kSkipFIFOCompaction)); } -#endif // ROCKSDB_LITE TEST_F(DBTest, ComparatorCheck) { class NewComparator : public Comparator { @@ -2440,7 +2413,6 @@ TEST_F(DBTest, DestroyDBMetaDatabase) { ASSERT_TRUE(!(DB::Open(options, metametadbname, &db)).ok()); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, SnapshotFiles) { do { Options options = CurrentOptions(); @@ -2667,7 +2639,6 @@ TEST_F(DBTest, GetLiveBlobFiles) { ASSERT_EQ(cfmd.blob_file_count, 1U); ASSERT_EQ(cfmd.blob_file_size, bmd.blob_file_size); } -#endif TEST_F(DBTest, PurgeInfoLogs) { Options options = CurrentOptions(); @@ -2715,7 +2686,6 @@ TEST_F(DBTest, PurgeInfoLogs) { } } -#ifndef ROCKSDB_LITE // Multi-threaded test: namespace { @@ -2902,7 +2872,6 @@ INSTANTIATE_TEST_CASE_P( ::testing::Combine( ::testing::ValuesIn(MultiThreadedDBTest::GenerateOptionConfigs()), ::testing::Bool())); -#endif // ROCKSDB_LITE // Group commit test: #if !defined(OS_WIN) @@ -3109,7 +3078,6 @@ class ModelDB : public DB { return s; } -#ifndef ROCKSDB_LITE using DB::IngestExternalFile; Status IngestExternalFile( ColumnFamilyHandle* /*column_family*/, @@ -3151,7 +3119,6 @@ class ModelDB : public DB { std::size_t /*n*/, TablePropertiesCollection* /*props*/) override { return Status(); } -#endif // ROCKSDB_LITE using DB::KeyMayExist; bool KeyMayExist(const ReadOptions& /*options*/, @@ -3332,7 +3299,6 @@ class ModelDB : public DB { Status DisableFileDeletions() override { return Status::OK(); } Status EnableFileDeletions(bool /*force*/) override { return Status::OK(); } -#ifndef ROCKSDB_LITE Status GetLiveFiles(std::vector&, uint64_t* /*size*/, bool /*flush_memtable*/ = true) override { @@ -3376,7 +3342,6 @@ class ModelDB : public DB { void GetColumnFamilyMetaData(ColumnFamilyHandle* /*column_family*/, ColumnFamilyMetaData* /*metadata*/) override {} -#endif // ROCKSDB_LITE Status GetDbIdentity(std::string& /*identity*/) const override { return Status::OK(); @@ -3625,12 +3590,10 @@ TEST_F(DBTest, BlockBasedTablePrefixIndexTest) { ASSERT_EQ("v1", Get("k1")); ASSERT_EQ("v2", Get("k2")); -#ifndef ROCKSDB_LITE // Back to original ASSERT_OK(dbfull()->SetOptions({{"prefix_extractor", "fixed:1"}})); ASSERT_EQ("v1", Get("k1")); ASSERT_EQ("v2", Get("k2")); -#endif // !ROCKSDB_LITE // Same if there's a problem initally loading prefix transform options.prefix_extractor.reset(NewFixedPrefixTransform(1)); @@ -3642,12 +3605,10 @@ TEST_F(DBTest, BlockBasedTablePrefixIndexTest) { ASSERT_EQ("v1", Get("k1")); ASSERT_EQ("v2", Get("k2")); -#ifndef ROCKSDB_LITE // Change again ASSERT_OK(dbfull()->SetOptions({{"prefix_extractor", "fixed:2"}})); ASSERT_EQ("v1", Get("k1")); ASSERT_EQ("v2", Get("k2")); -#endif // !ROCKSDB_LITE SyncPoint::GetInstance()->DisableProcessing(); // Reopen with no prefix extractor, make sure everything still works. @@ -3769,7 +3730,6 @@ TEST_F(DBTest, ChecksumTest) { ASSERT_EQ("h", Get("g")); } -#ifndef ROCKSDB_LITE TEST_P(DBTestWithParam, FIFOCompactionTest) { for (int iter = 0; iter < 2; ++iter) { // first iteration -- auto compaction @@ -4141,9 +4101,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLTest) { options.compaction_options_fifo.max_table_files_size); } } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE /* * This test is not reliable enough as it heavily depends on disk behavior. * Disable as it is flaky. @@ -4324,7 +4282,6 @@ TEST_F(DBTest, ConcurrentMemtableNotSupported) { ASSERT_NOK(db_->CreateColumnFamily(cf_options, "name", &handle)); } -#endif // ROCKSDB_LITE TEST_F(DBTest, SanitizeNumThreads) { for (int attempt = 0; attempt < 2; attempt++) { @@ -4478,7 +4435,6 @@ TEST_F(DBTest, ManualFlushWalAndWriteRace) { ASSERT_EQ("value2", Get("foo2")); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, DynamicMemtableOptions) { const uint64_t k64KB = 1 << 16; const uint64_t k128KB = 1 << 17; @@ -4632,7 +4588,6 @@ TEST_F(DBTest, DynamicMemtableOptions) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#endif // ROCKSDB_LITE #ifdef ROCKSDB_USING_THREAD_STATUS namespace { @@ -5082,7 +5037,6 @@ TEST_P(DBTestWithParam, PreShutdownCompactionMiddle) { #endif // ROCKSDB_USING_THREAD_STATUS -#ifndef ROCKSDB_LITE TEST_F(DBTest, FlushOnDestroy) { WriteOptions wo; wo.disableWAL = true; @@ -5635,7 +5589,6 @@ TEST_F(DBTest, DynamicUniversalCompactionOptions) { dbfull()->GetOptions().compaction_options_universal.allow_trivial_move, false); } -#endif // ROCKSDB_LITE TEST_F(DBTest, FileCreationRandomFailure) { Options options; @@ -5698,7 +5651,6 @@ TEST_F(DBTest, FileCreationRandomFailure) { } } -#ifndef ROCKSDB_LITE TEST_F(DBTest, DynamicMiscOptions) { // Test max_sequential_skip_in_iterations @@ -5793,7 +5745,6 @@ TEST_F(DBTest, DynamicMiscOptions) { &mutable_cf_options)); ASSERT_FALSE(mutable_cf_options.check_flush_compaction_key_order); } -#endif // ROCKSDB_LITE TEST_F(DBTest, L0L1L2AndUpHitCounter) { const int kNumLevels = 3; @@ -6012,7 +5963,6 @@ TEST_F(DBTest, MergeTestTime) { #endif // ROCKSDB_USING_THREAD_STATUS } -#ifndef ROCKSDB_LITE TEST_P(DBTestWithParam, MergeCompactionTimeTest) { SetPerfLevel(kEnableTime); Options options = CurrentOptions(); @@ -6075,7 +6025,6 @@ TEST_P(DBTestWithParam, FilterCompactionTimeTest) { TestGetTickerCount(options, FILTER_OPERATION_TOTAL_TIME)); delete itr; } -#endif // ROCKSDB_LITE TEST_F(DBTest, TestLogCleanup) { Options options = CurrentOptions(); @@ -6092,7 +6041,6 @@ TEST_F(DBTest, TestLogCleanup) { } } -#ifndef ROCKSDB_LITE TEST_F(DBTest, EmptyCompactedDB) { Options options = CurrentOptions(); options.max_open_files = -1; @@ -6102,9 +6050,7 @@ TEST_F(DBTest, EmptyCompactedDB) { ASSERT_TRUE(s.IsNotSupported()); Close(); } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(DBTest, SuggestCompactRangeTest) { class CompactionFilterFactoryGetContext : public CompactionFilterFactory { public: @@ -6333,7 +6279,6 @@ TEST_F(DBTest, CompactRangeWithEmptyBottomLevel) { ASSERT_EQ(NumTableFilesAtLevel(0), 0); ASSERT_EQ(NumTableFilesAtLevel(1), kNumL0Files); } -#endif // ROCKSDB_LITE TEST_F(DBTest, AutomaticConflictsWithManualCompaction) { const int kNumL0Files = 50; @@ -6391,7 +6336,6 @@ TEST_F(DBTest, AutomaticConflictsWithManualCompaction) { ASSERT_OK(dbfull()->TEST_WaitForCompact()); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, CompactFilesShouldTriggerAutoCompaction) { Options options = CurrentOptions(); options.max_background_compactions = 1; @@ -6451,7 +6395,6 @@ TEST_F(DBTest, CompactFilesShouldTriggerAutoCompaction) { ASSERT_LE(cf_meta_data.levels[0].files.size(), options.level0_file_num_compaction_trigger); } -#endif // ROCKSDB_LITE // Github issue #595 // Large write batch with column families @@ -6662,7 +6605,7 @@ TEST_F(DBTest, HardLimit) { sleeping_task_low.WaitUntilDone(); } -#if !defined(ROCKSDB_LITE) && !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) +#if !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) class WriteStallListener : public EventListener { public: WriteStallListener() : condition_(WriteStallCondition::kNormal) {} @@ -6904,8 +6847,7 @@ TEST_F(DBTest, LastWriteBufferDelay) { sleeping_task.WakeUp(); sleeping_task.WaitUntilDone(); } -#endif // !defined(ROCKSDB_LITE) && - // !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) +#endif // !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) TEST_F(DBTest, FailWhenCompressionNotSupportedTest) { CompressionType compressions[] = {kZlibCompression, kBZip2Compression, @@ -6941,7 +6883,6 @@ TEST_F(DBTest, CreateColumnFamilyShouldFailOnIncompatibleOptions) { delete handle; } -#ifndef ROCKSDB_LITE TEST_F(DBTest, RowCache) { Options options = CurrentOptions(); options.statistics = ROCKSDB_NAMESPACE::CreateDBStatistics(); @@ -7073,7 +7014,6 @@ TEST_F(DBTest, ReusePinnableSlice) { 1); } -#endif // ROCKSDB_LITE TEST_F(DBTest, DeletingOldWalAfterDrop) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->LoadDependency( @@ -7199,7 +7139,6 @@ TEST_F(DBTest, LargeBlockSizeTest) { ASSERT_NOK(TryReopenWithColumnFamilies({"default", "pikachu"}, options)); } -#ifndef ROCKSDB_LITE TEST_F(DBTest, CreationTimeOfOldestFile) { const int kNumKeysPerFile = 32; @@ -7388,7 +7327,6 @@ TEST_F(DBTest, ShuttingDownNotBlockStalledWrites) { thd.join(); } -#endif } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_test2.cc b/db/db_test2.cc index 308bc504b5b..544d9b299d6 100644 --- a/db/db_test2.cc +++ b/db/db_test2.cc @@ -48,7 +48,6 @@ class DBTest2 : public DBTestBase { } }; -#ifndef ROCKSDB_LITE TEST_F(DBTest2, OpenForReadOnly) { DB* db_ptr = nullptr; std::string dbname = test::PerThreadDBPath("db_readonly"); @@ -146,7 +145,6 @@ TEST_F(DBTest2, PartitionedIndexUserToInternalKey) { } } -#endif // ROCKSDB_LITE class PrefixFullBloomWithReverseComparator : public DBTestBase, @@ -290,7 +288,6 @@ TEST_F(DBTest2, MaxSuccessiveMergesChangeWithDBRecovery) { Reopen(options); } -#ifndef ROCKSDB_LITE class DBTestSharedWriteBufferAcrossCFs : public DBTestBase, public testing::WithParamInterface> { @@ -1544,9 +1541,7 @@ TEST_P(PresetCompressionDictTest, CompactNonBottommost) { } ASSERT_OK(Flush()); } -#ifndef ROCKSDB_LITE ASSERT_EQ("2,0,1", FilesPerLevel(0)); -#endif // ROCKSDB_LITE uint64_t prev_compression_dict_bytes_inserted = TestGetTickerCount(options, BLOCK_CACHE_COMPRESSION_DICT_BYTES_INSERT); @@ -1554,9 +1549,7 @@ TEST_P(PresetCompressionDictTest, CompactNonBottommost) { // file is not bottommost due to the existing L2 file covering the same key- // range. ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,1,1", FilesPerLevel(0)); -#endif // ROCKSDB_LITE // We can use `BLOCK_CACHE_COMPRESSION_DICT_BYTES_INSERT` to detect whether a // compression dictionary exists since dictionaries would be preloaded when // the compaction finishes. @@ -1620,17 +1613,13 @@ TEST_P(PresetCompressionDictTest, CompactBottommost) { } ASSERT_OK(Flush()); } -#ifndef ROCKSDB_LITE ASSERT_EQ("2", FilesPerLevel(0)); -#endif // ROCKSDB_LITE uint64_t prev_compression_dict_bytes_inserted = TestGetTickerCount(options, BLOCK_CACHE_COMPRESSION_DICT_BYTES_INSERT); CompactRangeOptions cro; ASSERT_OK(db_->CompactRange(cro, nullptr, nullptr)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,1", FilesPerLevel(0)); -#endif // ROCKSDB_LITE ASSERT_GT( TestGetTickerCount(options, BLOCK_CACHE_COMPRESSION_DICT_BYTES_INSERT), prev_compression_dict_bytes_inserted); @@ -1997,7 +1986,6 @@ TEST_F(DBTest2, CompactionStall) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#endif // ROCKSDB_LITE TEST_F(DBTest2, FirstSnapshotTest) { Options options; @@ -2014,7 +2002,6 @@ TEST_F(DBTest2, FirstSnapshotTest) { db_->ReleaseSnapshot(s1); } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, DuplicateSnapshot) { Options options; options = CurrentOptions(options); @@ -2046,7 +2033,6 @@ TEST_F(DBTest2, DuplicateSnapshot) { db_->ReleaseSnapshot(s); } } -#endif // ROCKSDB_LITE class PinL0IndexAndFilterBlocksTest : public DBTestBase, @@ -2291,7 +2277,6 @@ INSTANTIATE_TEST_CASE_P(PinL0IndexAndFilterBlocksTest, std::make_tuple(false, false), std::make_tuple(false, true))); -#ifndef ROCKSDB_LITE TEST_F(DBTest2, MaxCompactionBytesTest) { Options options = CurrentOptions(); options.memtable_factory.reset(test::NewSpecialSkipListFactory( @@ -2657,7 +2642,6 @@ TEST_F(DBTest2, SyncPointMarker) { ASSERT_EQ(sync_point_called.load(), 1); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#endif size_t GetEncodedEntrySize(size_t key_size, size_t value_size) { std::string buffer; @@ -2864,7 +2848,6 @@ TEST_F(DBTest2, ReadAmpBitmapLiveInCacheAfterDBClose) { } #endif // !OS_SOLARIS -#ifndef ROCKSDB_LITE TEST_F(DBTest2, AutomaticCompactionOverlapManualCompaction) { Options options = CurrentOptions(); options.num_levels = 3; @@ -3145,9 +3128,7 @@ TEST_F(DBTest2, PausingManualCompaction3) { DestroyAndReopen(options); generate_files(); -#ifndef ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", FilesPerLevel()); -#endif // !ROCKSDB_LITE int run_manual_compactions = 0; ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->SetCallBack( "CompactionJob::Run():PausingManualCompaction:1", @@ -3161,18 +3142,14 @@ TEST_F(DBTest2, PausingManualCompaction3) { ASSERT_OK(dbfull()->TEST_WaitForCompact(true)); // As manual compaction disabled, not even reach sync point ASSERT_EQ(run_manual_compactions, 0); -#ifndef ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", FilesPerLevel()); -#endif // !ROCKSDB_LITE ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearCallBack( "CompactionJob::Run():PausingManualCompaction:1"); dbfull()->EnableManualCompaction(); ASSERT_OK(dbfull()->CompactRange(compact_options, nullptr, nullptr)); ASSERT_OK(dbfull()->TEST_WaitForCompact(true)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,0,0,0,0,0,2", FilesPerLevel()); -#endif // !ROCKSDB_LITE ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } @@ -3201,9 +3178,7 @@ TEST_F(DBTest2, PausingManualCompaction4) { DestroyAndReopen(options); generate_files(); -#ifndef ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", FilesPerLevel()); -#endif // !ROCKSDB_LITE int run_manual_compactions = 0; ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->SetCallBack( "CompactionJob::Run():PausingManualCompaction:2", [&](void* arg) { @@ -3230,17 +3205,13 @@ TEST_F(DBTest2, PausingManualCompaction4) { .IsManualCompactionPaused()); ASSERT_OK(dbfull()->TEST_WaitForCompact(true)); ASSERT_EQ(run_manual_compactions, 1); -#ifndef ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", FilesPerLevel()); -#endif // !ROCKSDB_LITE ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearCallBack( "CompactionJob::Run():PausingManualCompaction:2"); ASSERT_OK(dbfull()->CompactRange(compact_options, nullptr, nullptr)); ASSERT_OK(dbfull()->TEST_WaitForCompact(true)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,0,0,0,0,0,2", FilesPerLevel()); -#endif // !ROCKSDB_LITE ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } @@ -3273,9 +3244,7 @@ TEST_F(DBTest2, CancelManualCompaction1) { DestroyAndReopen(options); generate_files(); -#ifndef ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", FilesPerLevel()); -#endif // !ROCKSDB_LITE int run_manual_compactions = 0; ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->SetCallBack( @@ -3299,9 +3268,7 @@ TEST_F(DBTest2, CancelManualCompaction1) { // E.g. we should call the compaction function exactly one time. ASSERT_EQ(compactions_run, 0); ASSERT_EQ(run_manual_compactions, 0); -#ifndef ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", FilesPerLevel()); -#endif // !ROCKSDB_LITE compactions_run = 0; ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearCallBack( @@ -3332,9 +3299,7 @@ TEST_F(DBTest2, CancelManualCompaction1) { compact_options.canceled->store(false, std::memory_order_relaxed); ASSERT_OK(dbfull()->CompactRange(compact_options, nullptr, nullptr)); ASSERT_OK(dbfull()->TEST_WaitForCompact(true)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,0,0,0,0,0,2", FilesPerLevel()); -#endif // !ROCKSDB_LITE ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } @@ -3368,9 +3333,7 @@ TEST_F(DBTest2, CancelManualCompaction2) { DestroyAndReopen(options); generate_files(); -#ifndef ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", FilesPerLevel()); -#endif // !ROCKSDB_LITE ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->EnableProcessing(); @@ -3418,9 +3381,7 @@ TEST_F(DBTest2, CancelManualCompaction2) { compact_options.canceled->store(false, std::memory_order_relaxed); ASSERT_OK(dbfull()->CompactRange(compact_options, nullptr, nullptr)); ASSERT_OK(dbfull()->TEST_WaitForCompact(true)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,0,0,0,0,0,2", FilesPerLevel()); -#endif // !ROCKSDB_LITE ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } @@ -3648,7 +3609,6 @@ TEST_F(DBTest2, OptimizeForSmallDB) { value.Reset(); } -#endif // ROCKSDB_LITE TEST_F(DBTest2, IterRaceFlush1) { ASSERT_OK(Put("foo", "v1")); @@ -3931,7 +3891,6 @@ TEST_F(DBTest2, LowPriWrite) { ASSERT_EQ(1, rate_limit_count.load()); } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, RateLimitedCompactionReads) { // compaction input has 512KB data const int kNumKeysPerFile = 128; @@ -4012,7 +3971,6 @@ TEST_F(DBTest2, RateLimitedCompactionReads) { } } } -#endif // ROCKSDB_LITE // Make sure DB can be reopen with reduced number of levels, given no file // is on levels higher than the new num_levels. @@ -4025,21 +3983,15 @@ TEST_F(DBTest2, ReduceLevel) { ASSERT_OK(Put("foo", "bar")); ASSERT_OK(Flush()); MoveFilesToLevel(6); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,0,0,0,0,0,1", FilesPerLevel()); -#endif // !ROCKSDB_LITE CompactRangeOptions compact_options; compact_options.change_level = true; compact_options.target_level = 1; ASSERT_OK(dbfull()->CompactRange(compact_options, nullptr, nullptr)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,1", FilesPerLevel()); -#endif // !ROCKSDB_LITE options.num_levels = 3; Reopen(options); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,1", FilesPerLevel()); -#endif // !ROCKSDB_LITE } // Test that ReadCallback is actually used in both memtbale and sst tables @@ -4074,18 +4026,14 @@ TEST_F(DBTest2, ReadCallbackTest) { } ASSERT_OK(Flush()); MoveFilesToLevel(6); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,0,0,0,0,0,2", FilesPerLevel()); -#endif // !ROCKSDB_LITE for (; i < 30; i++) { ASSERT_OK(Put(key, value + std::to_string(i))); auto snapshot = dbfull()->GetSnapshot(); snapshots.push_back(snapshot); } ASSERT_OK(Flush()); -#ifndef ROCKSDB_LITE ASSERT_EQ("1,0,0,0,0,0,2", FilesPerLevel()); -#endif // !ROCKSDB_LITE // And also add some values to the memtable for (; i < 40; i++) { ASSERT_OK(Put(key, value + std::to_string(i))); @@ -4127,7 +4075,6 @@ TEST_F(DBTest2, ReadCallbackTest) { } } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, LiveFilesOmitObsoleteFiles) { // Regression test for race condition where an obsolete file is returned to @@ -5196,7 +5143,6 @@ TEST_F(DBTest2, TraceWithFilter) { ASSERT_EQ(count, 6); } -#endif // ROCKSDB_LITE TEST_F(DBTest2, PinnableSliceAndMmapReads) { Options options = CurrentOptions(); @@ -5227,7 +5173,6 @@ TEST_F(DBTest2, PinnableSliceAndMmapReads) { // compaction. It crashes if it does. ASSERT_EQ(pinned_value.ToString(), "bar"); -#ifndef ROCKSDB_LITE pinned_value.Reset(); // Unsafe to pin mmap files when they could be kicked out of table cache Close(); @@ -5245,7 +5190,6 @@ TEST_F(DBTest2, PinnableSliceAndMmapReads) { ASSERT_EQ(Get("foo", &pinned_value), Status::OK()); ASSERT_TRUE(pinned_value.IsPinned()); ASSERT_EQ(pinned_value.ToString(), "bar"); -#endif } TEST_F(DBTest2, DISABLED_IteratorPinnedMemory) { @@ -5478,7 +5422,6 @@ TEST_F(DBTest2, TestGetColumnFamilyHandleUnlocked) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, TestCompactFiles) { // Setup sync point dependency to reproduce the race condition of // DBImpl::GetColumnFamilyHandleUnlocked @@ -5546,7 +5489,6 @@ TEST_F(DBTest2, TestCompactFiles) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); } -#endif // ROCKSDB_LITE TEST_F(DBTest2, MultiDBParallelOpenTest) { const int kNumDbs = 2; @@ -5732,7 +5674,6 @@ TEST_F(DBTest2, PrefixBloomFilteredOut) { delete iter; } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, RowCacheSnapshot) { Options options = CurrentOptions(); options.statistics = ROCKSDB_NAMESPACE::CreateDBStatistics(); @@ -5776,7 +5717,6 @@ TEST_F(DBTest2, RowCacheSnapshot) { db_->ReleaseSnapshot(s2); db_->ReleaseSnapshot(s3); } -#endif // ROCKSDB_LITE // When DB is reopened with multiple column families, the manifest file // is written after the first CF is flushed, and it is written again @@ -5966,9 +5906,7 @@ TEST_F(DBTest2, SameSmallestInSameLevel) { ASSERT_OK(db_->Merge(WriteOptions(), "key", "8")); ASSERT_OK(Flush()); ASSERT_OK(dbfull()->TEST_WaitForCompact(true)); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,4,1", FilesPerLevel()); -#endif // ROCKSDB_LITE ASSERT_EQ("2,3,4,5,6,7,8", Get("key")); } @@ -6101,11 +6039,7 @@ TEST_F(DBTest2, ChangePrefixExtractor) { // Sometimes filter is checked based on upper bound. Assert counters // for that case. Otherwise, only check data correctness. -#ifndef ROCKSDB_LITE bool expect_filter_check = !use_partitioned_filter; -#else - bool expect_filter_check = false; -#endif table_options.partition_filters = use_partitioned_filter; if (use_partitioned_filter) { table_options.index_type = @@ -6303,7 +6237,6 @@ TEST_F(DBTest2, BlockBasedTablePrefixGetIndexNotFound) { ASSERT_EQ("ok", Get("b1")); } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, AutoPrefixMode1) { do { // create a DB with block prefix index @@ -7181,7 +7114,6 @@ TEST_F(DBTest2, FileTemperatureManifestFixup) { std::vector column_families; for (size_t i = 0; i < handles_.size(); ++i) { ColumnFamilyDescriptor cfdescriptor; - // GetDescriptor is not implemented for ROCKSDB_LITE handles_[i]->GetDescriptor(&cfdescriptor).PermitUncheckedError(); column_families.push_back(cfdescriptor); } @@ -7221,7 +7153,6 @@ TEST_F(DBTest2, FileTemperatureManifestFixup) { Close(); } -#endif // ROCKSDB_LITE // WAL recovery mode is WALRecoveryMode::kPointInTimeRecovery. TEST_F(DBTest2, PointInTimeRecoveryWithIOErrorWhileReadingWal) { @@ -7277,7 +7208,6 @@ TEST_F(DBTest2, PointInTimeRecoveryWithSyncFailureInCFCreation) { ReopenWithColumnFamilies({"default", "test1", "test2"}, options); } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, SortL0FilesByEpochNumber) { Options options = CurrentOptions(); options.num_levels = 1; @@ -7487,7 +7417,6 @@ TEST_F(DBTest2, RecoverEpochNumber) { } } -#endif // ROCKSDB_LITE TEST_F(DBTest2, RenameDirectory) { Options options = CurrentOptions(); @@ -7565,9 +7494,7 @@ TEST_F(DBTest2, SstUniqueIdVerifyBackwardCompatible) { } ASSERT_OK(dbfull()->TEST_WaitForCompact()); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,1", FilesPerLevel(0)); -#endif // ROCKSDB_LITE // Reopen (with verification) ASSERT_TRUE(options.verify_sst_unique_id_in_manifest); @@ -7622,9 +7549,7 @@ TEST_F(DBTest2, SstUniqueIdVerify) { } ASSERT_OK(dbfull()->TEST_WaitForCompact()); -#ifndef ROCKSDB_LITE ASSERT_EQ("0,1", FilesPerLevel(0)); -#endif // ROCKSDB_LITE // Reopen with verification should fail options.verify_sst_unique_id_in_manifest = true; @@ -7747,7 +7672,6 @@ TEST_F(DBTest2, BestEffortsRecoveryWithSstUniqueIdVerification) { } } -#ifndef ROCKSDB_LITE TEST_F(DBTest2, GetLatestSeqAndTsForKey) { Destroy(last_options_); @@ -7804,7 +7728,6 @@ TEST_F(DBTest2, GetLatestSeqAndTsForKey) { // Verify that no read to SST files. ASSERT_EQ(0, options.statistics->getTickerCount(GET_HIT_L0)); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_test_util.cc b/db/db_test_util.cc index a7e817f3fa5..f169034fcee 100644 --- a/db/db_test_util.cc +++ b/db/db_test_util.cc @@ -70,7 +70,6 @@ DBTestBase::DBTestBase(const std::string path, bool env_do_fsync) if (getenv("MEM_ENV")) { mem_env_ = MockEnv::Create(base_env, base_env->GetSystemClock()); } -#ifndef ROCKSDB_LITE if (getenv("ENCRYPTED_ENV")) { std::shared_ptr provider; std::string provider_id = getenv("ENCRYPTED_ENV"); @@ -82,7 +81,6 @@ DBTestBase::DBTestBase(const std::string path, bool env_do_fsync) &provider)); encrypted_env_ = NewEncryptedEnv(mem_env_ ? mem_env_ : base_env, provider); } -#endif // !ROCKSDB_LITE env_ = new SpecialEnv(encrypted_env_ ? encrypted_env_ : (mem_env_ ? mem_env_ : base_env)); env_->SetBackgroundThreads(1, Env::LOW); @@ -124,22 +122,6 @@ DBTestBase::~DBTestBase() { } bool DBTestBase::ShouldSkipOptions(int option_config, int skip_mask) { -#ifdef ROCKSDB_LITE - // These options are not supported in ROCKSDB_LITE - if (option_config == kHashSkipList || - option_config == kPlainTableFirstBytePrefix || - option_config == kPlainTableCappedPrefix || - option_config == kPlainTableCappedPrefixNonMmap || - option_config == kPlainTableAllBytesPrefix || - option_config == kVectorRep || option_config == kHashLinkList || - option_config == kUniversalCompaction || - option_config == kUniversalCompactionMultiLevel || - option_config == kUniversalSubcompactions || - option_config == kFIFOCompaction || - option_config == kConcurrentSkipList) { - return true; - } -#endif if ((skip_mask & kSkipUniversalCompaction) && (option_config == kUniversalCompaction || @@ -377,7 +359,6 @@ Options DBTestBase::GetOptions( bool can_allow_mmap = IsMemoryMappedAccessSupported(); switch (option_config) { -#ifndef ROCKSDB_LITE case kHashSkipList: options.prefix_extractor.reset(NewFixedPrefixTransform(1)); options.memtable_factory.reset(NewHashSkipListRepFactory(16)); @@ -431,7 +412,6 @@ Options DBTestBase::GetOptions( SetupSyncPointsToMockDirectIO(); break; } -#endif // ROCKSDB_LITE case kMergePut: options.merge_operator = MergeOperators::CreatePutOperator(); break; @@ -702,7 +682,6 @@ void DBTestBase::Destroy(const Options& options, bool delete_cf_paths) { if (delete_cf_paths) { for (size_t i = 0; i < handles_.size(); ++i) { ColumnFamilyDescriptor cfdescriptor; - // GetDescriptor is not implemented for ROCKSDB_LITE handles_[i]->GetDescriptor(&cfdescriptor).PermitUncheckedError(); column_families.push_back(cfdescriptor); } @@ -1043,7 +1022,6 @@ std::string DBTestBase::AllEntriesFor(const Slice& user_key, int cf) { return result; } -#ifndef ROCKSDB_LITE int DBTestBase::NumSortedRuns(int cf) { ColumnFamilyMetaData cf_meta; if (cf == 0) { @@ -1162,7 +1140,6 @@ std::string DBTestBase::FilesPerLevel(int cf) { return result; } -#endif // !ROCKSDB_LITE std::vector DBTestBase::GetBlobFileNumbers() { VersionSet* const versions = dbfull()->GetVersionSet(); @@ -1280,7 +1257,6 @@ void DBTestBase::MoveFilesToLevel(int level, int cf) { } } -#ifndef ROCKSDB_LITE void DBTestBase::DumpFileCounts(const char* label) { fprintf(stderr, "---\n%s:\n", label); fprintf(stderr, "maxoverlap: %" PRIu64 "\n", @@ -1292,7 +1268,6 @@ void DBTestBase::DumpFileCounts(const char* label) { } } } -#endif // !ROCKSDB_LITE std::string DBTestBase::DumpSSTableList() { std::string property; @@ -1618,7 +1593,6 @@ void DBTestBase::VerifyDBFromMap(std::map true_data, } if (tailing_iter) { -#ifndef ROCKSDB_LITE // Tailing iterator int iter_cnt = 0; ReadOptions ro; @@ -1647,7 +1621,6 @@ void DBTestBase::VerifyDBFromMap(std::map true_data, } delete iter; -#endif // ROCKSDB_LITE } if (total_reads_res) { @@ -1675,7 +1648,6 @@ void DBTestBase::VerifyDBInternal( iter->~InternalIterator(); } -#ifndef ROCKSDB_LITE uint64_t DBTestBase::GetNumberOfSstFilesForColumnFamily( DB* db, std::string column_family_name) { @@ -1696,7 +1668,6 @@ uint64_t DBTestBase::GetSstSizeHelper(Temperature temperature) { &prop)); return static_cast(std::atoi(prop.c_str())); } -#endif // ROCKSDB_LITE void VerifySstUniqueIds(const TablePropertiesCollection& props) { ASSERT_FALSE(props.empty()); // suspicious test if empty diff --git a/db/db_test_util.h b/db/db_test_util.h index 8e86dfa64be..66a5d692677 100644 --- a/db/db_test_util.h +++ b/db/db_test_util.h @@ -695,7 +695,6 @@ class SpecialEnv : public EnvWrapper { bool no_slowdown_; }; -#ifndef ROCKSDB_LITE class FileTemperatureTestFS : public FileSystemWrapper { public: explicit FileTemperatureTestFS(const std::shared_ptr& fs) @@ -870,7 +869,6 @@ class FlushCounterListener : public EventListener { ASSERT_EQ(expected_flush_reason.load(), flush_job_info.flush_reason); } }; -#endif // A test merge operator mimics put but also fails if one of merge operands is // "corrupted", "corrupted_try_merge", or "corrupted_must_merge". @@ -1260,7 +1258,6 @@ class DBTestBase : public testing::Test { const std::vector& cfs, const Options& options); -#ifndef ROCKSDB_LITE int NumSortedRuns(int cf = 0); uint64_t TotalSize(int cf = 0); @@ -1276,7 +1273,6 @@ class DBTestBase : public testing::Test { double CompressionRatioAtLevel(int level, int cf = 0); int TotalTableFiles(int cf = 0, int levels = -1); -#endif // ROCKSDB_LITE std::vector GetBlobFileNumbers(); @@ -1312,9 +1308,7 @@ class DBTestBase : public testing::Test { void MoveFilesToLevel(int level, int cf = 0); -#ifndef ROCKSDB_LITE void DumpFileCounts(const char* label); -#endif // ROCKSDB_LITE std::string DumpSSTableList(); @@ -1383,12 +1377,10 @@ class DBTestBase : public testing::Test { void VerifyDBInternal( std::vector> true_data); -#ifndef ROCKSDB_LITE uint64_t GetNumberOfSstFilesForColumnFamily(DB* db, std::string column_family_name); uint64_t GetSstSizeHelper(Temperature temperature); -#endif // ROCKSDB_LITE uint64_t TestGetTickerCount(const Options& options, Tickers ticker_type) { return options.statistics->getTickerCount(ticker_type); diff --git a/db/db_universal_compaction_test.cc b/db/db_universal_compaction_test.cc index f53c36f229a..bb6b67d9bdf 100644 --- a/db/db_universal_compaction_test.cc +++ b/db/db_universal_compaction_test.cc @@ -9,7 +9,6 @@ #include "db/db_test_util.h" #include "port/stack_trace.h" -#if !defined(ROCKSDB_LITE) #include "rocksdb/utilities/table_properties_collectors.h" #include "test_util/sync_point.h" #include "test_util/testutil.h" @@ -2220,16 +2219,9 @@ TEST_F(DBTestUniversalCompaction2, PeriodicCompaction) { } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) int main(int argc, char** argv) { -#if !defined(ROCKSDB_LITE) ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -#else - (void)argc; - (void)argv; - return 0; -#endif } diff --git a/db/db_wal_test.cc b/db/db_wal_test.cc index 99d0b3c4c8d..9cb9364d375 100644 --- a/db/db_wal_test.cc +++ b/db/db_wal_test.cc @@ -444,7 +444,6 @@ TEST_F(DBWALTest, RecoverWithBlob) { ASSERT_EQ(blob_file->GetTotalBlobCount(), 1); -#ifndef ROCKSDB_LITE const InternalStats* const internal_stats = cfd->internal_stats(); ASSERT_NE(internal_stats, nullptr); @@ -460,7 +459,6 @@ TEST_F(DBWALTest, RecoverWithBlob) { ASSERT_EQ(cf_stats_value[InternalStats::BYTES_FLUSHED], compaction_stats[0].bytes_written + compaction_stats[0].bytes_written_blob); -#endif // ROCKSDB_LITE } TEST_F(DBWALTest, RecoverWithBlobMultiSST) { @@ -610,7 +608,6 @@ TEST_F(DBWALTest, WALWithChecksumHandoff) { #endif // ROCKSDB_ASSERT_STATUS_CHECKED } -#ifndef ROCKSDB_LITE TEST_F(DBWALTest, LockWal) { do { Options options = CurrentOptions(); @@ -654,7 +651,6 @@ TEST_F(DBWALTest, LockWal) { SyncPoint::GetInstance()->DisableProcessing(); } while (ChangeWalOptions()); } -#endif //! ROCKSDB_LITE class DBRecoveryTestBlobError : public DBWALTest, @@ -892,7 +888,6 @@ TEST_F(DBWALTest, PreallocateBlock) { } #endif // !(defined NDEBUG) || !defined(OS_WIN) -#ifndef ROCKSDB_LITE TEST_F(DBWALTest, DISABLED_FullPurgePreservesRecycledLog) { // TODO(ajkr): Disabled until WAL recycling is fixed for // `kPointInTimeRecovery`. @@ -2372,7 +2367,6 @@ TEST_F(DBWALTest, WalInManifestButNotInSortedWals) { Close(); } -#endif // ROCKSDB_LITE TEST_F(DBWALTest, WalTermTest) { Options options = CurrentOptions(); @@ -2398,7 +2392,6 @@ TEST_F(DBWALTest, WalTermTest) { ASSERT_EQ("NOT_FOUND", Get(1, "foo2")); } -#ifndef ROCKSDB_LITE TEST_F(DBWALTest, GetCompressedWalsAfterSync) { if (db_->GetOptions().wal_compression == kNoCompression) { ROCKSDB_GTEST_BYPASS("stream compression not present"); @@ -2433,7 +2426,6 @@ TEST_F(DBWALTest, GetCompressedWalsAfterSync) { Status s = dbfull()->GetSortedWalFiles(wals); ASSERT_OK(s); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/db/db_with_timestamp_basic_test.cc b/db/db_with_timestamp_basic_test.cc index 4208169236d..31ebb25c2ac 100644 --- a/db/db_with_timestamp_basic_test.cc +++ b/db/db_with_timestamp_basic_test.cc @@ -13,9 +13,7 @@ #include "rocksdb/utilities/debug.h" #include "table/block_based/block_based_table_reader.h" #include "table/block_based/block_builder.h" -#if !defined(ROCKSDB_LITE) #include "test_util/sync_point.h" -#endif #include "test_util/testutil.h" #include "utilities/fault_injection_env.h" #include "utilities/merge_operators/string_append/stringappend2.h" @@ -645,7 +643,6 @@ TEST_F(DBBasicTestWithTimestamp, OpenAndTrimHistoryInvalidOptionTest) { .IsInvalidArgument()); } -#ifndef ROCKSDB_LITE TEST_F(DBBasicTestWithTimestamp, GetTimestampTableProperties) { Options options = CurrentOptions(); const size_t kTimestampSize = Timestamp(0, 0).size(); @@ -675,7 +672,6 @@ TEST_F(DBBasicTestWithTimestamp, GetTimestampTableProperties) { } Close(); } -#endif // !ROCKSDB_LITE class DBBasicTestWithTimestampTableOptions : public DBBasicTestWithTimestampBase, @@ -2677,7 +2673,6 @@ TEST_P(DBBasicTestWithTimestampCompressionSettings, PutDeleteGet) { } } -#ifndef ROCKSDB_LITE // A class which remembers the name of each flushed file. class FlushedFileCollector : public EventListener { public: @@ -2970,7 +2965,6 @@ TEST_F(DBBasicTestWithTimestamp, MultiGetNoReturnTs) { Close(); } -#endif // !ROCKSDB_LITE INSTANTIATE_TEST_CASE_P( Timestamp, DBBasicTestWithTimestampCompressionSettings, diff --git a/db/db_with_timestamp_compaction_test.cc b/db/db_with_timestamp_compaction_test.cc index 403d9907c57..7d80c85c42b 100644 --- a/db/db_with_timestamp_compaction_test.cc +++ b/db/db_with_timestamp_compaction_test.cc @@ -198,7 +198,6 @@ class TestFilePartitionerFactory : public SstPartitionerFactory { const char* Name() const override { return "TestFilePartitionerFactory"; } }; -#ifndef ROCKSDB_LITE TEST_F(TimestampCompatibleCompactionTest, CompactFilesRangeCheckL0) { Options options = CurrentOptions(); options.env = env_; @@ -344,7 +343,6 @@ TEST_F(TimestampCompatibleCompactionTest, EmptyCompactionOutput) { cro.bottommost_level_compaction = BottommostLevelCompaction::kForce; ASSERT_OK(db_->CompactRange(cro, nullptr, nullptr)); } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_write_buffer_manager_test.cc b/db/db_write_buffer_manager_test.cc index 4c31a782465..29424454715 100644 --- a/db/db_write_buffer_manager_test.cc +++ b/db/db_write_buffer_manager_test.cc @@ -780,7 +780,6 @@ TEST_P(DBWriteBufferManagerTest, MixedSlowDownOptionsMultipleDB) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#ifndef ROCKSDB_LITE // Tests a `WriteBufferManager` constructed with `allow_stall == false` does not // thrash memtable switching when full and a CF receives multiple writes. @@ -847,7 +846,6 @@ TEST_P(DBWriteBufferManagerTest, StopSwitchingMemTablesOnceFlushing) { delete shared_wbm_db; } -#endif // ROCKSDB_LITE INSTANTIATE_TEST_CASE_P(DBWriteBufferManagerTest, DBWriteBufferManagerTest, testing::Bool()); diff --git a/db/deletefile_test.cc b/db/deletefile_test.cc index 34925e828b7..481eda7dd21 100644 --- a/db/deletefile_test.cc +++ b/db/deletefile_test.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include @@ -602,13 +601,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as DBImpl::DeleteFile is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/error_handler.cc b/db/error_handler.cc index 7f68bb026c2..98c3e82d5ff 100644 --- a/db/error_handler.cc +++ b/db/error_handler.cc @@ -228,7 +228,6 @@ std::map, Status::Severity> }; void ErrorHandler::CancelErrorRecovery() { -#ifndef ROCKSDB_LITE db_mutex_->AssertHeld(); // We'll release the lock before calling sfm, so make sure no new @@ -249,7 +248,6 @@ void ErrorHandler::CancelErrorRecovery() { // If auto recovery is also runing to resume from the retryable error, // we should wait and end the auto recovery. EndAutoRecovery(); -#endif } STATIC_AVOID_DESTRUCTION(const Status, kOkStatus){Status::OK()}; @@ -499,7 +497,6 @@ const Status& ErrorHandler::SetBGError(const Status& bg_status, Status ErrorHandler::OverrideNoSpaceError(const Status& bg_error, bool* auto_recovery) { -#ifndef ROCKSDB_LITE if (bg_error.severity() >= Status::Severity::kFatalError) { return bg_error; } @@ -528,14 +525,9 @@ Status ErrorHandler::OverrideNoSpaceError(const Status& bg_error, } return bg_error; -#else - (void)auto_recovery; - return Status(bg_error, Status::Severity::kFatalError); -#endif } void ErrorHandler::RecoverFromNoSpace() { -#ifndef ROCKSDB_LITE SstFileManagerImpl* sfm = reinterpret_cast(db_options_.sst_file_manager.get()); @@ -543,11 +535,9 @@ void ErrorHandler::RecoverFromNoSpace() { if (sfm) { sfm->StartErrorRecovery(this, bg_error_); } -#endif } Status ErrorHandler::ClearBGError() { -#ifndef ROCKSDB_LITE db_mutex_->AssertHeld(); // Signal that recovery succeeded @@ -566,13 +556,9 @@ Status ErrorHandler::ClearBGError() { bg_error_, db_mutex_); } return recovery_error_; -#else - return bg_error_; -#endif } Status ErrorHandler::RecoverFromBGError(bool is_manual) { -#ifndef ROCKSDB_LITE InstrumentedMutexLock l(db_mutex_); bool no_bg_work_original_flag = soft_error_no_bg_work_; if (is_manual) { @@ -625,15 +611,10 @@ Status ErrorHandler::RecoverFromBGError(bool is_manual) { recovery_in_prog_ = false; } return s; -#else - (void)is_manual; - return bg_error_; -#endif } const Status& ErrorHandler::StartRecoverFromRetryableBGIOError( const IOStatus& io_error) { -#ifndef ROCKSDB_LITE db_mutex_->AssertHeld(); if (bg_error_.ok()) { return bg_error_; @@ -667,16 +648,11 @@ const Status& ErrorHandler::StartRecoverFromRetryableBGIOError( } else { return bg_error_; } -#else - (void)io_error; - return bg_error_; -#endif } // Automatic recover from Retryable BG IO error. Must be called after db // mutex is released. void ErrorHandler::RecoverFromRetryableBGIOError() { -#ifndef ROCKSDB_LITE TEST_SYNC_POINT("RecoverFromRetryableBGIOError:BeforeStart"); InstrumentedMutexLock l(db_mutex_); if (end_recovery_) { @@ -784,9 +760,6 @@ void ErrorHandler::RecoverFromRetryableBGIOError() { ERROR_HANDLER_AUTORESUME_RETRY_COUNT, retry_count); } return; -#else - return; -#endif } void ErrorHandler::CheckAndSetRecoveryAndBGError(const Status& bg_err) { diff --git a/db/error_handler_fs_test.cc b/db/error_handler_fs_test.cc index 153f3b79ef2..03411aa170c 100644 --- a/db/error_handler_fs_test.cc +++ b/db/error_handler_fs_test.cc @@ -6,16 +6,13 @@ // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "db/db_test_util.h" #include "file/sst_file_manager_impl.h" #include "port/stack_trace.h" #include "rocksdb/io_status.h" #include "rocksdb/sst_file_manager.h" -#if !defined(ROCKSDB_LITE) #include "test_util/sync_point.h" -#endif #include "util/random.h" #include "utilities/fault_injection_env.h" #include "utilities/fault_injection_fs.h" @@ -2864,12 +2861,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as Cuckoo table is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/db/event_helpers.cc b/db/event_helpers.cc index 7987b8ec6a5..0a53f4a1afe 100644 --- a/db/event_helpers.cc +++ b/db/event_helpers.cc @@ -10,13 +10,11 @@ #include "rocksdb/utilities/customizable_util.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE Status EventListener::CreateFromString(const ConfigOptions& config_options, const std::string& id, std::shared_ptr* result) { return LoadSharedObject(config_options, id, nullptr, result); } -#endif // ROCKSDB_LITE namespace { template @@ -32,7 +30,6 @@ void EventHelpers::AppendCurrentTime(JSONWriter* jwriter) { .count(); } -#ifndef ROCKSDB_LITE void EventHelpers::NotifyTableFileCreationStarted( const std::vector>& listeners, const std::string& db_name, const std::string& cf_name, @@ -50,13 +47,11 @@ void EventHelpers::NotifyTableFileCreationStarted( listener->OnTableFileCreationStarted(info); } } -#endif // !ROCKSDB_LITE void EventHelpers::NotifyOnBackgroundError( const std::vector>& listeners, BackgroundErrorReason reason, Status* bg_error, InstrumentedMutex* db_mutex, bool* auto_recovery) { -#ifndef ROCKSDB_LITE if (listeners.empty()) { return; } @@ -71,13 +66,6 @@ void EventHelpers::NotifyOnBackgroundError( } } db_mutex->Lock(); -#else - (void)listeners; - (void)reason; - (void)bg_error; - (void)db_mutex; - (void)auto_recovery; -#endif // ROCKSDB_LITE } void EventHelpers::LogAndNotifyTableFileCreationFinished( @@ -179,7 +167,6 @@ void EventHelpers::LogAndNotifyTableFileCreationFinished( event_logger->Log(jwriter); } -#ifndef ROCKSDB_LITE if (listeners.empty()) { return; } @@ -198,13 +185,6 @@ void EventHelpers::LogAndNotifyTableFileCreationFinished( listener->OnTableFileCreated(info); } info.status.PermitUncheckedError(); -#else - (void)listeners; - (void)db_name; - (void)cf_name; - (void)file_path; - (void)reason; -#endif // !ROCKSDB_LITE } void EventHelpers::LogAndNotifyTableFileDeletion( @@ -226,7 +206,6 @@ void EventHelpers::LogAndNotifyTableFileDeletion( event_logger->Log(jwriter); -#ifndef ROCKSDB_LITE if (listeners.empty()) { return; } @@ -239,18 +218,12 @@ void EventHelpers::LogAndNotifyTableFileDeletion( listener->OnTableFileDeleted(info); } info.status.PermitUncheckedError(); -#else - (void)file_path; - (void)dbname; - (void)listeners; -#endif // !ROCKSDB_LITE } void EventHelpers::NotifyOnErrorRecoveryEnd( const std::vector>& listeners, const Status& old_bg_error, const Status& new_bg_error, InstrumentedMutex* db_mutex) { -#ifndef ROCKSDB_LITE if (!listeners.empty()) { db_mutex->AssertHeld(); // release lock while notifying events @@ -266,15 +239,8 @@ void EventHelpers::NotifyOnErrorRecoveryEnd( } db_mutex->Lock(); } -#else - (void)listeners; - (void)old_bg_error; - (void)new_bg_error; - (void)db_mutex; -#endif // ROCKSDB_LITE } -#ifndef ROCKSDB_LITE void EventHelpers::NotifyBlobFileCreationStarted( const std::vector>& listeners, const std::string& db_name, const std::string& cf_name, @@ -289,7 +255,6 @@ void EventHelpers::NotifyBlobFileCreationStarted( listener->OnBlobFileCreationStarted(info); } } -#endif // !ROCKSDB_LITE void EventHelpers::LogAndNotifyBlobFileCreationFinished( EventLogger* event_logger, @@ -314,7 +279,6 @@ void EventHelpers::LogAndNotifyBlobFileCreationFinished( event_logger->Log(jwriter); } -#ifndef ROCKSDB_LITE if (listeners.empty()) { return; } @@ -325,12 +289,6 @@ void EventHelpers::LogAndNotifyBlobFileCreationFinished( listener->OnBlobFileCreated(info); } info.status.PermitUncheckedError(); -#else - (void)listeners; - (void)db_name; - (void)file_path; - (void)creation_reason; -#endif } void EventHelpers::LogAndNotifyBlobFileDeletion( @@ -352,7 +310,6 @@ void EventHelpers::LogAndNotifyBlobFileDeletion( jwriter.EndObject(); event_logger->Log(jwriter); } -#ifndef ROCKSDB_LITE if (listeners.empty()) { return; } @@ -361,11 +318,6 @@ void EventHelpers::LogAndNotifyBlobFileDeletion( listener->OnBlobFileDeleted(info); } info.status.PermitUncheckedError(); -#else - (void)listeners; - (void)dbname; - (void)file_path; -#endif // !ROCKSDB_LITE } } // namespace ROCKSDB_NAMESPACE diff --git a/db/event_helpers.h b/db/event_helpers.h index 68d819fe6bd..a1331d8a9a8 100644 --- a/db/event_helpers.h +++ b/db/event_helpers.h @@ -19,12 +19,10 @@ namespace ROCKSDB_NAMESPACE { class EventHelpers { public: static void AppendCurrentTime(JSONWriter* json_writer); -#ifndef ROCKSDB_LITE static void NotifyTableFileCreationStarted( const std::vector>& listeners, const std::string& db_name, const std::string& cf_name, const std::string& file_path, int job_id, TableFileCreationReason reason); -#endif // !ROCKSDB_LITE static void NotifyOnBackgroundError( const std::vector>& listeners, BackgroundErrorReason reason, Status* bg_error, @@ -48,13 +46,11 @@ class EventHelpers { const Status& old_bg_error, const Status& new_bg_error, InstrumentedMutex* db_mutex); -#ifndef ROCKSDB_LITE static void NotifyBlobFileCreationStarted( const std::vector>& listeners, const std::string& db_name, const std::string& cf_name, const std::string& file_path, int job_id, BlobFileCreationReason creation_reason); -#endif // !ROCKSDB_LITE static void LogAndNotifyBlobFileCreationFinished( EventLogger* event_logger, diff --git a/db/experimental.cc b/db/experimental.cc index 20b5daa970b..0e49eeca049 100644 --- a/db/experimental.cc +++ b/db/experimental.cc @@ -12,7 +12,6 @@ namespace ROCKSDB_NAMESPACE { namespace experimental { -#ifndef ROCKSDB_LITE Status SuggestCompactRange(DB* db, ColumnFamilyHandle* column_family, const Slice* begin, const Slice* end) { @@ -30,19 +29,6 @@ Status PromoteL0(DB* db, ColumnFamilyHandle* column_family, int target_level) { return db->PromoteL0(column_family, target_level); } -#else // ROCKSDB_LITE - -Status SuggestCompactRange(DB* /*db*/, ColumnFamilyHandle* /*column_family*/, - const Slice* /*begin*/, const Slice* /*end*/) { - return Status::NotSupported("Not supported in RocksDB LITE"); -} - -Status PromoteL0(DB* /*db*/, ColumnFamilyHandle* /*column_family*/, - int /*target_level*/) { - return Status::NotSupported("Not supported in RocksDB LITE"); -} - -#endif // ROCKSDB_LITE Status SuggestCompactRange(DB* db, const Slice* begin, const Slice* end) { return SuggestCompactRange(db, db->DefaultColumnFamily(), begin, end); diff --git a/db/external_sst_file_basic_test.cc b/db/external_sst_file_basic_test.cc index c12313a4ffd..d6f3d355a4c 100644 --- a/db/external_sst_file_basic_test.cc +++ b/db/external_sst_file_basic_test.cc @@ -17,7 +17,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE class ExternalSSTFileBasicTest : public DBTestBase, public ::testing::WithParamInterface> { @@ -1988,7 +1987,6 @@ INSTANTIATE_TEST_CASE_P(ExternalSSTFileBasicTest, ExternalSSTFileBasicTest, std::make_tuple(false, true), std::make_tuple(false, false))); -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index 6437fdc498c..448e707384a 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/external_sst_file_ingestion_job.h" @@ -1096,4 +1095,3 @@ Status ExternalSstFileIngestionJob::SyncIngestedFile(TWritableFile* file) { } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/external_sst_file_test.cc b/db/external_sst_file_test.cc index fcb2e7c9435..50596d1e953 100644 --- a/db/external_sst_file_test.cc +++ b/db/external_sst_file_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include @@ -2858,14 +2857,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as External SST File Writer and Ingestion are not supported " - "in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/flush_job.cc b/db/flush_job.cc index e99497a1c6a..8193f594f8b 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -596,12 +596,10 @@ Status FlushJob::MemPurge() { // we do not call SchedulePendingFlush(). cfd_->imm()->Add(new_mem, &job_context_->memtables_to_free); new_mem->Ref(); -#ifndef ROCKSDB_LITE // Piggyback FlushJobInfo on the first flushed memtable. db_mutex_->AssertHeld(); meta_.fd.file_size = 0; mems_[0]->SetFlushJobInfo(GetFlushJobInfo()); -#endif // !ROCKSDB_LITE db_mutex_->Unlock(); } else { s = Status::Aborted(Slice("Mempurge filled more than one memtable.")); @@ -1006,10 +1004,8 @@ Status FlushJob::WriteLevel0Table() { meta_.unique_id, meta_.compensated_range_deletion_size); edit_->SetBlobFileAdditions(std::move(blob_file_additions)); } -#ifndef ROCKSDB_LITE // Piggyback FlushJobInfo on the first first flushed memtable. mems_[0]->SetFlushJobInfo(GetFlushJobInfo()); -#endif // !ROCKSDB_LITE // Note that here we treat flush as level 0 compaction in internal stats InternalStats::CompactionStats stats(CompactionReason::kFlush, 1); @@ -1059,7 +1055,6 @@ Env::IOPriority FlushJob::GetRateLimiterPriorityForWrite() { return Env::IO_HIGH; } -#ifndef ROCKSDB_LITE std::unique_ptr FlushJob::GetFlushJobInfo() const { db_mutex_->AssertHeld(); std::unique_ptr info(new FlushJobInfo{}); @@ -1091,6 +1086,5 @@ std::unique_ptr FlushJob::GetFlushJobInfo() const { } return info; } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/flush_job.h b/db/flush_job.h index 062ef299760..d3902f0bd07 100644 --- a/db/flush_job.h +++ b/db/flush_job.h @@ -89,11 +89,9 @@ class FlushJob { void Cancel(); const autovector& GetMemTables() const { return mems_; } -#ifndef ROCKSDB_LITE std::list>* GetCommittedFlushJobsInfo() { return &committed_flush_jobs_info_; } -#endif // !ROCKSDB_LITE private: friend class FlushJobTest_GetRateLimiterPriorityForWrite_Test; @@ -127,9 +125,7 @@ class FlushJob { bool MemPurgeDecider(double threshold); // The rate limiter priority (io_priority) is determined dynamically here. Env::IOPriority GetRateLimiterPriorityForWrite(); -#ifndef ROCKSDB_LITE std::unique_ptr GetFlushJobInfo() const; -#endif // !ROCKSDB_LITE const std::string& dbname_; const std::string db_id_; diff --git a/db/flush_job_test.cc b/db/flush_job_test.cc index 003a1a6570c..72332fc3a21 100644 --- a/db/flush_job_test.cc +++ b/db/flush_job_test.cc @@ -427,11 +427,9 @@ TEST_F(FlushJobTest, FlushMemtablesMultipleColumnFamilies) { } autovector>*> committed_flush_jobs_info; -#ifndef ROCKSDB_LITE for (auto& job : flush_jobs) { committed_flush_jobs_info.push_back(job->GetCommittedFlushJobsInfo()); } -#endif //! ROCKSDB_LITE Status s = InstallMemtableAtomicFlushResults( nullptr /* imm_lists */, all_cfds, mutable_cf_options_list, mems_list, diff --git a/db/forward_iterator.cc b/db/forward_iterator.cc index 3fbc2cf4706..7c9afea4403 100644 --- a/db/forward_iterator.cc +++ b/db/forward_iterator.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/forward_iterator.h" #include @@ -1059,4 +1058,3 @@ void ForwardIterator::DeleteIterator(InternalIterator* iter, bool is_arena) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/forward_iterator.h b/db/forward_iterator.h index 5a5c6f0f376..748f7a1f7f2 100644 --- a/db/forward_iterator.h +++ b/db/forward_iterator.h @@ -5,7 +5,6 @@ #pragma once #include "rocksdb/comparator.h" -#ifndef ROCKSDB_LITE #include #include @@ -165,4 +164,3 @@ class ForwardIterator : public InternalIterator { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/forward_iterator_bench.cc b/db/forward_iterator_bench.cc index 325661cef34..b57b119e484 100644 --- a/db/forward_iterator_bench.cc +++ b/db/forward_iterator_bench.cc @@ -3,7 +3,7 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#if !defined(GFLAGS) || defined(ROCKSDB_LITE) +#if !defined(GFLAGS) #include int main() { fprintf(stderr, "Please install gflags to run rocksdb tools\n"); @@ -375,4 +375,4 @@ int main(int argc, char** argv) { writers.clear(); readers.clear(); } -#endif // !defined(GFLAGS) || defined(ROCKSDB_LITE) +#endif // !defined(GFLAGS) diff --git a/db/import_column_family_job.cc b/db/import_column_family_job.cc index 17ad044a7e7..05b2f6d1d8b 100644 --- a/db/import_column_family_job.cc +++ b/db/import_column_family_job.cc @@ -5,7 +5,6 @@ // (found in the LICENSE.Apache file in the root directory). #include "db/version_builder.h" -#ifndef ROCKSDB_LITE #include "db/import_column_family_job.h" @@ -312,4 +311,3 @@ Status ImportColumnFamilyJob::GetIngestedFileInfo( } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/import_column_family_test.cc b/db/import_column_family_test.cc index 0c07ee2a8bf..f012483be8c 100644 --- a/db/import_column_family_test.cc +++ b/db/import_column_family_test.cc @@ -4,7 +4,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include @@ -630,14 +629,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as External SST File Writer and Import are not supported " - "in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/internal_stats.cc b/db/internal_stats.cc index bc7f315d953..a49657a734f 100644 --- a/db/internal_stats.cc +++ b/db/internal_stats.cc @@ -32,7 +32,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE const std::map InternalStats::compaction_level_stats = { @@ -1991,12 +1990,5 @@ void InternalStats::DumpCFFileHistogram(std::string* value) { value->append(oss.str()); } -#else - -const DBPropertyInfo* GetPropertyInfo(const Slice& /*property*/) { - return nullptr; -} - -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/internal_stats.h b/db/internal_stats.h index a833240637f..feb72dd7400 100644 --- a/db/internal_stats.h +++ b/db/internal_stats.h @@ -60,7 +60,6 @@ struct DBPropertyInfo { extern const DBPropertyInfo* GetPropertyInfo(const Slice& property); -#ifndef ROCKSDB_LITE #undef SCORE enum class LevelStatType { INVALID = 0, @@ -842,155 +841,5 @@ class InternalStats { uint64_t started_at_; }; -#else - -class InternalStats { - public: - enum InternalCFStatsType { - L0_FILE_COUNT_LIMIT_SLOWDOWNS, - LOCKED_L0_FILE_COUNT_LIMIT_SLOWDOWNS, - MEMTABLE_LIMIT_STOPS, - MEMTABLE_LIMIT_SLOWDOWNS, - L0_FILE_COUNT_LIMIT_STOPS, - LOCKED_L0_FILE_COUNT_LIMIT_STOPS, - PENDING_COMPACTION_BYTES_LIMIT_SLOWDOWNS, - PENDING_COMPACTION_BYTES_LIMIT_STOPS, - WRITE_STALLS_ENUM_MAX, - BYTES_FLUSHED, - BYTES_INGESTED_ADD_FILE, - INGESTED_NUM_FILES_TOTAL, - INGESTED_LEVEL0_NUM_FILES_TOTAL, - INGESTED_NUM_KEYS_TOTAL, - INTERNAL_CF_STATS_ENUM_MAX, - }; - - enum InternalDBStatsType { - kIntStatsWalFileBytes, - kIntStatsWalFileSynced, - kIntStatsBytesWritten, - kIntStatsNumKeysWritten, - kIntStatsWriteDoneByOther, - kIntStatsWriteDoneBySelf, - kIntStatsWriteWithWal, - kIntStatsWriteStallMicros, - kIntStatsNumMax, - }; - - InternalStats(int /*num_levels*/, SystemClock* /*clock*/, - ColumnFamilyData* /*cfd*/) {} - - // Per level compaction stats - struct CompactionOutputsStats { - uint64_t num_output_records = 0; - uint64_t bytes_written = 0; - uint64_t bytes_written_blob = 0; - uint64_t num_output_files = 0; - uint64_t num_output_files_blob = 0; - - void Add(const CompactionOutputsStats& stats) { - this->num_output_records += stats.num_output_records; - this->bytes_written += stats.bytes_written; - this->bytes_written_blob += stats.bytes_written_blob; - this->num_output_files += stats.num_output_files; - this->num_output_files_blob += stats.num_output_files_blob; - } - }; - - struct CompactionStats { - uint64_t micros; - uint64_t cpu_micros; - uint64_t bytes_read_non_output_levels; - uint64_t bytes_read_output_level; - uint64_t bytes_read_blob; - uint64_t bytes_written; - uint64_t bytes_written_blob; - uint64_t bytes_moved; - int num_input_files_in_non_output_levels; - int num_input_files_in_output_level; - int num_output_files; - int num_output_files_blob; - uint64_t num_input_records; - uint64_t num_dropped_records; - uint64_t num_output_records; - int count; - - explicit CompactionStats() {} - - explicit CompactionStats(CompactionReason /*reason*/, int /*c*/) {} - - explicit CompactionStats(const CompactionStats& /*c*/) {} - - void Add(const CompactionStats& /*c*/) {} - - void Add(const CompactionOutputsStats& /*c*/) {} - - void Subtract(const CompactionStats& /*c*/) {} - }; - - struct CompactionStatsFull { - // the stats for the target primary output level (per level stats) - CompactionStats stats; - - // stats for output_to_penultimate_level level (per level stats) - bool has_penultimate_level_output = false; - CompactionStats penultimate_level_stats; - - explicit CompactionStatsFull(){}; - - explicit CompactionStatsFull(CompactionReason /*reason*/, int /*c*/){}; - - uint64_t TotalBytesWritten() const { return 0; } - - uint64_t DroppedRecords() { return 0; } - - void SetMicros(uint64_t /*val*/){}; - - void AddCpuMicros(uint64_t /*val*/){}; - }; - - void AddCompactionStats(int /*level*/, Env::Priority /*thread_pri*/, - const CompactionStats& /*stats*/) {} - - void AddCompactionStats(int /*level*/, Env::Priority /*thread_pri*/, - const CompactionStatsFull& /*unmerged_stats*/) {} - - void IncBytesMoved(int /*level*/, uint64_t /*amount*/) {} - - void AddCFStats(InternalCFStatsType /*type*/, uint64_t /*value*/) {} - - void AddDBStats(InternalDBStatsType /*type*/, uint64_t /*value*/, - bool /*concurrent */ = false) {} - - HistogramImpl* GetFileReadHist(int /*level*/) { return nullptr; } - - HistogramImpl* GetBlobFileReadHist() { return nullptr; } - - uint64_t GetBackgroundErrorCount() const { return 0; } - - uint64_t BumpAndGetBackgroundErrorCount() { return 0; } - - bool GetStringProperty(const DBPropertyInfo& /*property_info*/, - const Slice& /*property*/, std::string* /*value*/) { - return false; - } - - bool GetMapProperty(const DBPropertyInfo& /*property_info*/, - const Slice& /*property*/, - std::map* /*value*/) { - return false; - } - - bool GetIntProperty(const DBPropertyInfo& /*property_info*/, - uint64_t* /*value*/, DBImpl* /*db*/) const { - return false; - } - - bool GetIntPropertyOutOfMutex(const DBPropertyInfo& /*property_info*/, - Version* /*version*/, - uint64_t* /*value*/) const { - return false; - } -}; -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/job_context.h b/db/job_context.h index 352c58e8239..a550ba2d46c 100644 --- a/db/job_context.h +++ b/db/job_context.h @@ -64,7 +64,7 @@ struct SuperVersionContext { WriteStallCondition new_cond, const std::string& name, const ImmutableOptions* ioptions) { -#if !defined(ROCKSDB_LITE) && !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) +#if !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) WriteStallNotification notif; notif.write_stall_info.cf_name = name; notif.write_stall_info.condition.prev = old_cond; @@ -76,12 +76,11 @@ struct SuperVersionContext { (void)new_cond; (void)name; (void)ioptions; -#endif // !defined(ROCKSDB_LITE) && - // !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) +#endif // !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) } void Clean() { -#if !defined(ROCKSDB_LITE) && !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) +#if !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION) // notify listeners on changed write stall conditions for (auto& notif : write_stall_notifications) { for (auto& listener : notif.immutable_options->listeners) { @@ -89,7 +88,7 @@ struct SuperVersionContext { } } write_stall_notifications.clear(); -#endif // !ROCKSDB_LITE +#endif // free superversions for (auto s : superversions_to_free) { delete s; diff --git a/db/listener_test.cc b/db/listener_test.cc index 756f5d12c7b..7c96bfd34e1 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -33,7 +33,6 @@ #include "util/string_util.h" #include "utilities/merge_operators.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { @@ -1591,7 +1590,6 @@ TEST_F(EventListenerTest, BlobDBFileTest) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE int main(int argc, char** argv) { ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); diff --git a/db/malloc_stats.cc b/db/malloc_stats.cc index 52f2e6e0f28..641e01f9a39 100644 --- a/db/malloc_stats.cc +++ b/db/malloc_stats.cc @@ -9,7 +9,6 @@ #include "db/malloc_stats.h" -#ifndef ROCKSDB_LITE #include #include @@ -52,4 +51,3 @@ void DumpMallocStats(std::string* stats) { void DumpMallocStats(std::string*) {} #endif // ROCKSDB_JEMALLOC } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/db/malloc_stats.h b/db/malloc_stats.h index 18aff3ad0f8..1cca8a9522c 100644 --- a/db/malloc_stats.h +++ b/db/malloc_stats.h @@ -9,7 +9,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -21,4 +20,3 @@ void DumpMallocStats(std::string*); } -#endif // !ROCKSDB_LITE diff --git a/db/memtable.cc b/db/memtable.cc index 943bd73c865..fae4fc97270 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -338,11 +338,7 @@ int MemTable::KeyComparator::operator()( } void MemTableRep::InsertConcurrently(KeyHandle /*handle*/) { -#ifndef ROCKSDB_LITE throw std::runtime_error("concurrent insert not supported"); -#else - abort(); -#endif } Slice MemTableRep::UserKey(const char* key) const { diff --git a/db/memtable.h b/db/memtable.h index 6db2721e46d..aa2ba87ca4a 100644 --- a/db/memtable.h +++ b/db/memtable.h @@ -499,7 +499,6 @@ class MemTable { flush_in_progress_ = in_progress; } -#ifndef ROCKSDB_LITE void SetFlushJobInfo(std::unique_ptr&& info) { flush_job_info_ = std::move(info); } @@ -507,7 +506,6 @@ class MemTable { std::unique_ptr ReleaseFlushJobInfo() { return std::move(flush_job_info_); } -#endif // !ROCKSDB_LITE // Returns a heuristic flush decision bool ShouldFlushNow(); @@ -616,10 +614,8 @@ class MemTable { // Gets refreshed inside `ApproximateMemoryUsage()` or `ShouldFlushNow` std::atomic approximate_memory_usage_; -#ifndef ROCKSDB_LITE // Flush job info of the current memtable. std::unique_ptr flush_job_info_; -#endif // !ROCKSDB_LITE // Updates flush_state_ using ShouldFlushNow() void UpdateFlushState(); diff --git a/db/memtable_list.cc b/db/memtable_list.cc index 1545003aded..ebcdf9b8eb0 100644 --- a/db/memtable_list.cc +++ b/db/memtable_list.cc @@ -529,14 +529,10 @@ Status MemTableList::TryInstallMemtableFlushResults( edit_list.push_back(&m->edit_); memtables_to_flush.push_back(m); -#ifndef ROCKSDB_LITE std::unique_ptr info = m->ReleaseFlushJobInfo(); if (info != nullptr) { committed_flush_jobs_info->push_back(std::move(info)); } -#else - (void)committed_flush_jobs_info; -#endif // !ROCKSDB_LITE } batch_count++; } @@ -825,7 +821,6 @@ Status InstallMemtableAtomicFlushResults( (*mems_list[k])[i]->SetFlushCompleted(true); (*mems_list[k])[i]->SetFileNumber(file_metas[k]->fd.GetNumber()); } -#ifndef ROCKSDB_LITE if (committed_flush_jobs_info[k]) { assert(!mems_list[k]->empty()); assert((*mems_list[k])[0]); @@ -833,9 +828,6 @@ Status InstallMemtableAtomicFlushResults( (*mems_list[k])[0]->ReleaseFlushJobInfo(); committed_flush_jobs_info[k]->push_back(std::move(flush_job_info)); } -#else //! ROCKSDB_LITE - (void)committed_flush_jobs_info; -#endif // ROCKSDB_LITE } Status s; diff --git a/db/memtable_list_test.cc b/db/memtable_list_test.cc index 8242061afb0..c63952b128c 100644 --- a/db/memtable_list_test.cc +++ b/db/memtable_list_test.cc @@ -67,11 +67,9 @@ class MemTableListTest : public testing::Test { ~MemTableListTest() override { if (db) { std::vector cf_descs(handles.size()); -#ifndef ROCKSDB_LITE for (int i = 0; i != static_cast(handles.size()); ++i) { EXPECT_OK(handles[i]->GetDescriptor(&cf_descs[i])); } -#endif // !ROCKSDB_LITE for (auto h : handles) { if (h) { EXPECT_OK(db->DestroyColumnFamilyHandle(h)); diff --git a/db/merge_test.cc b/db/merge_test.cc index 0d373d41ec7..6d1333e550a 100644 --- a/db/merge_test.cc +++ b/db/merge_test.cc @@ -104,8 +104,6 @@ std::shared_ptr OpenDb(const std::string& dbname, const bool ttl = false, options.env = EnvMergeTest::GetInstance(); EXPECT_OK(DestroyDB(dbname, Options())); Status s; -// DBWithTTL is not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE if (ttl) { DBWithTTL* db_with_ttl; s = DBWithTTL::Open(options, dbname, &db_with_ttl); @@ -113,10 +111,6 @@ std::shared_ptr OpenDb(const std::string& dbname, const bool ttl = false, } else { s = DB::Open(options, dbname, &db); } -#else - assert(!ttl); - s = DB::Open(options, dbname, &db); -#endif // !ROCKSDB_LITE EXPECT_OK(s); assert(s.ok()); // Allowed to call NowNanos during DB creation (in GenerateRawUniqueId() for @@ -595,7 +589,6 @@ TEST_F(MergeTest, MergeDbTest) { runTest(test::PerThreadDBPath("merge_testdb")); } -#ifndef ROCKSDB_LITE TEST_F(MergeTest, MergeDbTtlTest) { runTest(test::PerThreadDBPath("merge_testdbttl"), true); // Run test on TTL database @@ -613,7 +606,6 @@ TEST_F(MergeTest, MergeWithCompactionAndFlush) { } ASSERT_OK(DestroyDB(dbname, Options())); } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/obsolete_files_test.cc b/db/obsolete_files_test.cc index 8e9f28f65aa..03f38c09f68 100644 --- a/db/obsolete_files_test.cc +++ b/db/obsolete_files_test.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include @@ -316,13 +315,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as DBImpl::DeleteFile is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/options_file_test.cc b/db/options_file_test.cc index eb02e6ca4f1..c3adbeb642f 100644 --- a/db/options_file_test.cc +++ b/db/options_file_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include #include "db/db_impl/db_impl.h" @@ -109,12 +108,3 @@ int main(int argc, char** argv) { return 0; #endif // !(defined NDEBUG) || !defined(OS_WIN) } -#else - -#include - -int main(int /*argc*/, char** /*argv*/) { - printf("Skipped as Options file is not supported in RocksDBLite.\n"); - return 0; -} -#endif // !ROCKSDB_LITE diff --git a/db/perf_context_test.cc b/db/perf_context_test.cc index 454d12dc584..8694252a268 100644 --- a/db/perf_context_test.cc +++ b/db/perf_context_test.cc @@ -49,11 +49,9 @@ std::shared_ptr OpenDb(bool read_only = false) { FLAGS_min_write_buffer_number_to_merge; if (FLAGS_use_set_based_memetable) { -#ifndef ROCKSDB_LITE options.prefix_extractor.reset( ROCKSDB_NAMESPACE::NewFixedPrefixTransform(0)); options.memtable_factory.reset(NewHashSkipListRepFactory()); -#endif // ROCKSDB_LITE } Status s; @@ -498,7 +496,6 @@ void ProfileQueries(bool enabled_time = false) { } } -#ifndef ROCKSDB_LITE TEST_F(PerfContextTest, KeyComparisonCount) { SetPerfLevel(kEnableCount); ProfileQueries(); @@ -509,7 +506,6 @@ TEST_F(PerfContextTest, KeyComparisonCount) { SetPerfLevel(kEnableTime); ProfileQueries(true); } -#endif // ROCKSDB_LITE // make perf_context_test // export ROCKSDB_TESTS=PerfContextTest.SeekKeyComparison diff --git a/db/periodic_task_scheduler.cc b/db/periodic_task_scheduler.cc index 2024510dd60..1306f45da65 100644 --- a/db/periodic_task_scheduler.cc +++ b/db/periodic_task_scheduler.cc @@ -8,7 +8,6 @@ #include "rocksdb/system_clock.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { // `timer_mutex` is a global mutex serves 3 purposes currently: @@ -110,4 +109,3 @@ void PeriodicTaskScheduler::TEST_OverrideTimer(SystemClock* clock) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/periodic_task_scheduler.h b/db/periodic_task_scheduler.h index f45b80c4d81..4d129a67971 100644 --- a/db/periodic_task_scheduler.h +++ b/db/periodic_task_scheduler.h @@ -6,7 +6,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include "util/timer.h" @@ -107,4 +106,3 @@ class PeriodicTaskScheduler { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/periodic_task_scheduler_test.cc b/db/periodic_task_scheduler_test.cc index 73c13fa1384..c1205bcf612 100644 --- a/db/periodic_task_scheduler_test.cc +++ b/db/periodic_task_scheduler_test.cc @@ -12,7 +12,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE class PeriodicTaskSchedulerTest : public DBTestBase { public: PeriodicTaskSchedulerTest() @@ -220,7 +219,6 @@ TEST_F(PeriodicTaskSchedulerTest, MultiEnv) { Close(); } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/db/plain_table_db_test.cc b/db/plain_table_db_test.cc index 755b639b07f..737ad4ed26f 100644 --- a/db/plain_table_db_test.cc +++ b/db/plain_table_db_test.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include #include @@ -1346,12 +1345,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as plain table is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/prefix_test.cc b/db/prefix_test.cc index 8592b8f313c..a8ae040354a 100644 --- a/db/prefix_test.cc +++ b/db/prefix_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include @@ -893,14 +892,3 @@ int main(int argc, char** argv) { #endif // GFLAGS -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as HashSkipList and HashLinkList are not supported in " - "ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/repair.cc b/db/repair.cc index ddec43e9b60..0b3e120c9b2 100644 --- a/db/repair.cc +++ b/db/repair.cc @@ -60,7 +60,6 @@ // in the table's meta section to speed up ScanTable. #include "db/version_builder.h" -#ifndef ROCKSDB_LITE #include @@ -811,4 +810,3 @@ Status RepairDB(const std::string& dbname, const Options& options) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/repair_test.cc b/db/repair_test.cc index f80f2b722f7..47482699d9e 100644 --- a/db/repair_test.cc +++ b/db/repair_test.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #include "rocksdb/options.h" -#ifndef ROCKSDB_LITE #include #include @@ -21,7 +20,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE class RepairTest : public DBTestBase { public: RepairTest() : DBTestBase("repair_test", /*env_do_fsync=*/true) {} @@ -476,7 +474,6 @@ TEST_F(RepairTest, DbNameContainsTrailingSlash) { ReopenWithSstIdVerify(); ASSERT_EQ(Get("key"), "val"); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { @@ -485,12 +482,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as RepairDB is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/db/seqno_time_test.cc b/db/seqno_time_test.cc index c19dd1c91dc..dd93be7af5f 100644 --- a/db/seqno_time_test.cc +++ b/db/seqno_time_test.cc @@ -12,7 +12,6 @@ #include "rocksdb/utilities/debug.h" #include "test_util/mock_time_env.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { @@ -987,7 +986,6 @@ TEST_F(SeqnoTimeTest, EncodeDecodePerferNewTime) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE int main(int argc, char** argv) { ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); diff --git a/db/snapshot_checker.h b/db/snapshot_checker.h index 0bfb1aa07a1..b7ff1df8c01 100644 --- a/db/snapshot_checker.h +++ b/db/snapshot_checker.h @@ -52,9 +52,7 @@ class WritePreparedSnapshotChecker : public SnapshotChecker { SequenceNumber sequence, SequenceNumber snapshot_sequence) const override; private: -#ifndef ROCKSDB_LITE const WritePreparedTxnDB* const txn_db_; -#endif // !ROCKSDB_LITE }; } // namespace ROCKSDB_NAMESPACE diff --git a/db/table_cache.cc b/db/table_cache.cc index a5fa5fbe3c2..f456260bc67 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -53,7 +53,6 @@ static Slice GetSliceForFileNumber(const uint64_t* file_number) { sizeof(*file_number)); } -#ifndef ROCKSDB_LITE void AppendVarint64(IterKey* key, uint64_t v) { char buf[10]; @@ -61,7 +60,6 @@ void AppendVarint64(IterKey* key, uint64_t v) { key->TrimAppend(key->Size(), buf, ptr - buf); } -#endif // ROCKSDB_LITE } // anonymous namespace @@ -338,7 +336,6 @@ Status TableCache::GetRangeTombstoneIterator( return s; } -#ifndef ROCKSDB_LITE void TableCache::CreateRowCacheKeyPrefix(const ReadOptions& options, const FileDescriptor& fd, const Slice& internal_key, @@ -401,7 +398,6 @@ bool TableCache::GetFromRowCache(const Slice& user_key, IterKey& row_cache_key, } return found; } -#endif // ROCKSDB_LITE Status TableCache::Get( const ReadOptions& options, @@ -413,7 +409,6 @@ Status TableCache::Get( auto& fd = file_meta.fd; std::string* row_cache_entry = nullptr; bool done = false; -#ifndef ROCKSDB_LITE IterKey row_cache_key; std::string row_cache_entry_buffer; @@ -428,7 +423,6 @@ Status TableCache::Get( row_cache_entry = &row_cache_entry_buffer; } } -#endif // ROCKSDB_LITE Status s; TableReader* t = fd.table_reader; TypedHandle* handle = nullptr; @@ -475,7 +469,6 @@ Status TableCache::Get( } } -#ifndef ROCKSDB_LITE // Put the replay log in row cache only if something was found. if (!done && s.ok() && row_cache_entry && !row_cache_entry->empty()) { RowCacheInterface row_cache{ioptions_.row_cache.get()}; @@ -485,7 +478,6 @@ Status TableCache::Get( row_cache.Insert(row_cache_key.GetUserKey(), row_ptr, charge) .PermitUncheckedError(); } -#endif // ROCKSDB_LITE if (handle != nullptr) { cache_.Release(handle); @@ -523,7 +515,6 @@ Status TableCache::MultiGetFilter( HistogramImpl* file_read_hist, int level, MultiGetContext::Range* mget_range, TypedHandle** table_handle) { auto& fd = file_meta.fd; -#ifndef ROCKSDB_LITE IterKey row_cache_key; std::string row_cache_entry_buffer; @@ -534,7 +525,6 @@ Status TableCache::MultiGetFilter( if (ioptions_.row_cache && !first_key.get_context->NeedToReadSequence()) { return Status::NotSupported(); } -#endif // ROCKSDB_LITE Status s; TableReader* t = fd.table_reader; TypedHandle* handle = nullptr; diff --git a/db/table_cache_sync_and_async.h b/db/table_cache_sync_and_async.h index 9043ec8363c..b1ab73247ce 100644 --- a/db/table_cache_sync_and_async.h +++ b/db/table_cache_sync_and_async.h @@ -28,7 +28,6 @@ DEFINE_SYNC_AND_ASYNC(Status, TableCache::MultiGet) if (handle != nullptr && t == nullptr) { t = cache_.Value(handle); } -#ifndef ROCKSDB_LITE autovector row_cache_entries; IterKey row_cache_key; size_t row_cache_key_prefix_size = 0; @@ -59,7 +58,6 @@ DEFINE_SYNC_AND_ASYNC(Status, TableCache::MultiGet) } } } -#endif // ROCKSDB_LITE // Check that table_range is not empty. Its possible all keys may have been // found in the row cache and thus the range may now be empty @@ -96,7 +94,6 @@ DEFINE_SYNC_AND_ASYNC(Status, TableCache::MultiGet) } } -#ifndef ROCKSDB_LITE if (lookup_row_cache) { size_t row_idx = 0; RowCacheInterface row_cache{ioptions_.row_cache.get()}; @@ -122,7 +119,6 @@ DEFINE_SYNC_AND_ASYNC(Status, TableCache::MultiGet) } } } -#endif // ROCKSDB_LITE if (handle != nullptr) { cache_.Release(handle); diff --git a/db/table_properties_collector_test.cc b/db/table_properties_collector_test.cc index 5f0f205da1c..20f37e0c97d 100644 --- a/db/table_properties_collector_test.cc +++ b/db/table_properties_collector_test.cc @@ -355,7 +355,6 @@ TEST_P(TablePropertiesTest, CustomizedTablePropertiesCollector) { kBlockBasedTableMagicNumber, encode_as_internal, options, ikc); -#ifndef ROCKSDB_LITE // PlainTable is not supported in Lite // test plain table PlainTableOptions plain_table_options; plain_table_options.user_key_len = 8; @@ -367,7 +366,6 @@ TEST_P(TablePropertiesTest, CustomizedTablePropertiesCollector) { TestCustomizedTablePropertiesCollector(backward_mode_, kPlainTableMagicNumber, encode_as_internal, options, ikc); -#endif // !ROCKSDB_LITE } } @@ -486,7 +484,6 @@ TEST_P(TablePropertiesTest, InternalKeyPropertiesCollector) { std::make_shared()); } -#ifndef ROCKSDB_LITE // PlainTable is not supported in Lite PlainTableOptions plain_table_options; plain_table_options.user_key_len = 8; plain_table_options.bloom_bits_per_key = 8; @@ -495,7 +492,6 @@ TEST_P(TablePropertiesTest, InternalKeyPropertiesCollector) { TestInternalKeyPropertiesCollector( backward_mode_, kPlainTableMagicNumber, false /* not sanitize */, std::make_shared(plain_table_options)); -#endif // !ROCKSDB_LITE } INSTANTIATE_TEST_CASE_P(InternalKeyPropertiesCollector, TablePropertiesTest, diff --git a/db/transaction_log_impl.cc b/db/transaction_log_impl.cc index 3878b428aa6..8841b8cf3b2 100644 --- a/db/transaction_log_impl.cc +++ b/db/transaction_log_impl.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/transaction_log_impl.h" @@ -295,4 +294,3 @@ Status TransactionLogIteratorImpl::OpenLogReader(const LogFile* log_file) { return Status::OK(); } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/transaction_log_impl.h b/db/transaction_log_impl.h index e8c6efc02e4..6568de23f6c 100644 --- a/db/transaction_log_impl.h +++ b/db/transaction_log_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include "db/log_reader.h" @@ -127,4 +126,3 @@ class TransactionLogIteratorImpl : public TransactionLogIterator { Status OpenLogReader(const LogFile* file); }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/db/version_set.cc b/db/version_set.cc index 267f0c2d566..7bdd02650d0 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -5888,7 +5888,6 @@ Status VersionSet::ListColumnFamiliesFromManifest( return handler.status(); } -#ifndef ROCKSDB_LITE Status VersionSet::ReduceNumberOfLevels(const std::string& dbname, const Options* options, const FileOptions& file_options, @@ -6096,7 +6095,6 @@ Status VersionSet::DumpManifest(Options& options, std::string& dscname, return handler.status(); } -#endif // ROCKSDB_LITE void VersionSet::MarkFileNumberUsed(uint64_t number) { // only called during recovery and repair which are single threaded, so this diff --git a/db/version_set.h b/db/version_set.h index a5893e4a167..94b91bbcee0 100644 --- a/db/version_set.h +++ b/db/version_set.h @@ -1226,7 +1226,6 @@ class VersionSet { const std::string& manifest_path, FileSystem* fs, std::vector* column_families); -#ifndef ROCKSDB_LITE // Try to reduce the number of levels. This call is valid when // only one level from the new max level to the old // max level containing files. @@ -1248,7 +1247,6 @@ class VersionSet { Status DumpManifest(Options& options, std::string& manifestFileName, bool verbose, bool hex = false, bool json = false); -#endif // ROCKSDB_LITE const std::string& DbSessionId() const { return db_session_id_; } diff --git a/db/version_set_test.cc b/db/version_set_test.cc index 9234a4d880c..a83fabcd02f 100644 --- a/db/version_set_test.cc +++ b/db/version_set_test.cc @@ -3500,7 +3500,6 @@ class ChargeFileMetadataTestWithParam ChargeFileMetadataTestWithParam() {} }; -#ifndef ROCKSDB_LITE INSTANTIATE_TEST_CASE_P( ChargeFileMetadataTestWithParam, ChargeFileMetadataTestWithParam, ::testing::Values(CacheEntryRoleOptions::Decision::kEnabled, @@ -3611,7 +3610,6 @@ TEST_P(ChargeFileMetadataTestWithParam, Basic) { EXPECT_TRUE(s.ok()); } } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/db/wal_manager.cc b/db/wal_manager.cc index a6060235f21..400b2e58b6f 100644 --- a/db/wal_manager.cc +++ b/db/wal_manager.cc @@ -34,7 +34,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE Status WalManager::DeleteFile(const std::string& fname, uint64_t number) { auto s = env_->DeleteFile(wal_dir_ + "/" + fname); @@ -525,5 +524,4 @@ Status WalManager::ReadFirstLine(const std::string& fname, return status; } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/wal_manager.h b/db/wal_manager.h index 8cc0679357a..ab79bf00239 100644 --- a/db/wal_manager.h +++ b/db/wal_manager.h @@ -28,7 +28,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE // WAL manager provides the abstraction for reading the WAL files as a single // unit. Internally, it opens and reads the files using Reader or Writer @@ -134,5 +133,4 @@ class WalManager { std::shared_ptr io_tracer_; }; -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/db/wal_manager_test.cc b/db/wal_manager_test.cc index 4ad4e9749a1..0144e184682 100644 --- a/db/wal_manager_test.cc +++ b/db/wal_manager_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/wal_manager.h" @@ -335,12 +334,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as WalManager is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db/write_batch_test.cc b/db/write_batch_test.cc index d233853e21a..4bd74f71e17 100644 --- a/db/write_batch_test.cc +++ b/db/write_batch_test.cc @@ -677,7 +677,6 @@ TEST_F(WriteBatchTest, ColumnFamiliesBatchTest) { handler.seen); } -#ifndef ROCKSDB_LITE TEST_F(WriteBatchTest, ColumnFamiliesBatchWithIndexTest) { WriteBatchWithIndex batch; ColumnFamilyHandleImplDummy zero(0), two(2), three(3), eight(8); @@ -779,7 +778,6 @@ TEST_F(WriteBatchTest, ColumnFamiliesBatchWithIndexTest) { "Merge(omom, nom)", handler.seen); } -#endif // !ROCKSDB_LITE TEST_F(WriteBatchTest, SavePointTest) { Status s; diff --git a/db/write_callback_test.cc b/db/write_callback_test.cc index e6ebaae08c7..1be8593f16d 100644 --- a/db/write_callback_test.cc +++ b/db/write_callback_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/write_callback.h" @@ -453,13 +452,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as WriteWithCallback is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/db_stress_tool/cf_consistency_stress.cc b/db_stress_tool/cf_consistency_stress.cc index 33f7b1f2e3a..411f38d5984 100644 --- a/db_stress_tool/cf_consistency_stress.cc +++ b/db_stress_tool/cf_consistency_stress.cc @@ -466,7 +466,6 @@ class CfConsistencyStressTest : public StressTest { iters[i]->key().ToString(true /* hex */).c_str(), iters[i]->value().ToString(true /* hex */).c_str()); -#ifndef ROCKSDB_LITE Slice begin_key; Slice end_key; if (cmp < 0) { @@ -509,7 +508,6 @@ class CfConsistencyStressTest : public StressTest { } print_key_versions(column_families_[i]); -#endif // ROCKSDB_LITE shared->SetVerificationFailure(); } @@ -524,7 +522,6 @@ class CfConsistencyStressTest : public StressTest { } while (true); } -#ifndef ROCKSDB_LITE void ContinuouslyVerifyDb(ThreadState* thread) const override { assert(thread); Status status; @@ -614,9 +611,6 @@ class CfConsistencyStressTest : public StressTest { } } } -#else // ROCKSDB_LITE - void ContinuouslyVerifyDb(ThreadState* /*thread*/) const override {} -#endif // !ROCKSDB_LITE std::vector GenerateColumnFamilies( const int /* num_column_families */, diff --git a/db_stress_tool/db_stress_common.h b/db_stress_tool/db_stress_common.h index 397d22299e0..c1f9e7baf28 100644 --- a/db_stress_tool/db_stress_common.h +++ b/db_stress_tool/db_stress_common.h @@ -252,7 +252,6 @@ DECLARE_int32(continuous_verification_interval); DECLARE_int32(get_property_one_in); DECLARE_string(file_checksum_impl); -#ifndef ROCKSDB_LITE // Options for StackableDB-based BlobDB DECLARE_bool(use_blob_db); DECLARE_uint64(blob_db_min_blob_size); @@ -260,7 +259,6 @@ DECLARE_uint64(blob_db_bytes_per_sync); DECLARE_uint64(blob_db_file_size); DECLARE_bool(blob_db_enable_gc); DECLARE_double(blob_db_gc_cutoff); -#endif // !ROCKSDB_LITE // Options for integrated BlobDB DECLARE_bool(allow_setting_blob_options_dynamically); @@ -297,11 +295,9 @@ DECLARE_int32(secondary_cache_fault_one_in); DECLARE_int32(prepopulate_block_cache); DECLARE_bool(two_write_queues); -#ifndef ROCKSDB_LITE DECLARE_bool(use_only_the_last_commit_time_batch_for_recovery); DECLARE_uint64(wp_snapshot_cache_bits); DECLARE_uint64(wp_commit_cache_bits); -#endif // !ROCKSDB_LITE DECLARE_bool(adaptive_readahead); DECLARE_bool(async_io); diff --git a/db_stress_tool/db_stress_gflags.cc b/db_stress_tool/db_stress_gflags.cc index ef542db109e..ddedbdde968 100644 --- a/db_stress_tool/db_stress_gflags.cc +++ b/db_stress_tool/db_stress_gflags.cc @@ -390,7 +390,6 @@ DEFINE_double(experimental_mempurge_threshold, 0.0, DEFINE_bool(enable_write_thread_adaptive_yield, true, "Use a yielding spin loop for brief writer thread waits."); -#ifndef ROCKSDB_LITE // Options for StackableDB-based BlobDB DEFINE_bool(use_blob_db, false, "[Stacked BlobDB] Use BlobDB."); @@ -418,7 +417,6 @@ DEFINE_double( blob_db_gc_cutoff, ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().garbage_collection_cutoff, "[Stacked BlobDB] Cutoff ratio for BlobDB garbage collection."); -#endif // !ROCKSDB_LITE // Options for integrated BlobDB DEFINE_bool(allow_setting_blob_options_dynamically, false, @@ -983,13 +981,11 @@ DEFINE_int32(open_metadata_write_fault_one_in, 0, "On non-zero, enables fault injection on file metadata write " "during DB reopen."); -#ifndef ROCKSDB_LITE DEFINE_string(secondary_cache_uri, "", "Full URI for creating a customized secondary cache object"); DEFINE_int32(secondary_cache_fault_one_in, 0, "On non-zero, enables fault injection in secondary cache inserts" " and lookups"); -#endif // ROCKSDB_LITE DEFINE_int32(open_write_fault_one_in, 0, "On non-zero, enables fault injection on file writes " "during DB reopen."); @@ -1008,7 +1004,6 @@ DEFINE_int32(prepopulate_block_cache, DEFINE_bool(two_write_queues, false, "Set to true to enable two write queues. Default: false"); -#ifndef ROCKSDB_LITE DEFINE_bool(use_only_the_last_commit_time_batch_for_recovery, false, "If true, the commit-time write batch will not be immediately " @@ -1022,7 +1017,6 @@ DEFINE_uint64( DEFINE_uint64(wp_commit_cache_bits, 23ull, "Number of bits to represent write-prepared transaction db's " "commit cache. Default: 23 (8M entries)"); -#endif // !ROCKSDB_LITE DEFINE_bool(adaptive_readahead, false, "Carry forward internal auto readahead size from one file to next " diff --git a/db_stress_tool/db_stress_listener.cc b/db_stress_tool/db_stress_listener.cc index 578f21c415c..e2838c582a1 100644 --- a/db_stress_tool/db_stress_listener.cc +++ b/db_stress_tool/db_stress_listener.cc @@ -14,7 +14,6 @@ namespace ROCKSDB_NAMESPACE { #ifdef GFLAGS -#ifndef ROCKSDB_LITE // TODO: consider using expected_values_dir instead, but this is more // convenient for now. @@ -185,7 +184,6 @@ void DbStressListener::VerifyTableFileUniqueId( unique_ids_.Verify(id); } -#endif // !ROCKSDB_LITE #endif // GFLAGS } // namespace ROCKSDB_NAMESPACE diff --git a/db_stress_tool/db_stress_listener.h b/db_stress_tool/db_stress_listener.h index faced317259..97bbdaefa46 100644 --- a/db_stress_tool/db_stress_listener.h +++ b/db_stress_tool/db_stress_listener.h @@ -24,7 +24,6 @@ DECLARE_int32(compact_files_one_in); namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE // Verify across process executions that all seen IDs are unique class UniqueIdVerifier { public: @@ -266,6 +265,5 @@ class DbStressListener : public EventListener { std::atomic num_pending_file_creations_; UniqueIdVerifier unique_ids_; }; -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE #endif // GFLAGS diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 7d3f74d1413..2ec75958605 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -54,9 +54,8 @@ StressTest::StressTest() : cache_(NewCache(FLAGS_cache_size, FLAGS_cache_numshardbits)), filter_policy_(CreateFilterPolicy()), db_(nullptr), -#ifndef ROCKSDB_LITE txn_db_(nullptr), -#endif + db_aptr_(nullptr), clock_(db_stress_env->GetSystemClock().get()), new_column_family_name_(1), @@ -76,14 +75,10 @@ StressTest::StressTest() Options options; options.env = db_stress_env; // Remove files without preserving manfiest files -#ifndef ROCKSDB_LITE const Status s = !FLAGS_use_blob_db ? DestroyDB(FLAGS_db, options) : blob_db::DestroyBlobDB(FLAGS_db, options, blob_db::BlobDBOptions()); -#else - const Status s = DestroyDB(FLAGS_db, options); -#endif // !ROCKSDB_LITE if (!s.ok()) { fprintf(stderr, "Cannot destroy original db: %s\n", s.ToString().c_str()); @@ -125,7 +120,6 @@ std::shared_ptr StressTest::NewCache(size_t capacity, LRUCacheOptions opts; opts.capacity = capacity; opts.num_shard_bits = num_shard_bits; -#ifndef ROCKSDB_LITE std::shared_ptr secondary_cache; if (!FLAGS_secondary_cache_uri.empty()) { Status s = SecondaryCache::CreateFromString( @@ -143,7 +137,7 @@ std::shared_ptr StressTest::NewCache(size_t capacity, } opts.secondary_cache = secondary_cache; } -#endif + return NewLRUCache(opts); } else { fprintf(stderr, "Cache type not supported."); @@ -305,7 +299,6 @@ void StressTest::FinishInitDb(SharedState* shared) { exit(1); } } -#ifndef ROCKSDB_LITE if (FLAGS_use_txn) { // It's OK here without sync because unsynced data cannot be lost at this // point @@ -313,7 +306,7 @@ void StressTest::FinishInitDb(SharedState* shared) { // file is still directly writable until after FinishInitDb() ProcessRecoveredPreparedTxns(shared); } -#endif + if (FLAGS_enable_compaction_filter) { auto* compaction_filter_factory = reinterpret_cast( @@ -528,7 +521,6 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, s = db_->Merge(write_opts, cfh, key, v); } } else { -#ifndef ROCKSDB_LITE Transaction* txn; s = NewTxn(write_opts, &txn); if (s.ok()) { @@ -537,7 +529,6 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, s = CommitTxn(txn); } } -#endif } } else if (FLAGS_use_put_entity_one_in > 0) { s = db_->PutEntity(write_opts, cfh, key, @@ -550,7 +541,6 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, s = db_->Put(write_opts, cfh, key, v); } } else { -#ifndef ROCKSDB_LITE Transaction* txn; s = NewTxn(write_opts, &txn); if (s.ok()) { @@ -559,7 +549,6 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, s = CommitTxn(txn); } } -#endif } } @@ -583,9 +572,7 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, column_families_.clear(); delete db_; db_ = nullptr; -#ifndef ROCKSDB_LITE txn_db_ = nullptr; -#endif db_preload_finished_.store(true); auto now = clock_->NowMicros(); @@ -623,7 +610,6 @@ Status StressTest::SetOptions(ThreadState* thread) { return db_->SetOptions(cfh, opts); } -#ifndef ROCKSDB_LITE void StressTest::ProcessRecoveredPreparedTxns(SharedState* shared) { assert(txn_db_); std::vector recovered_prepared_trans; @@ -730,7 +716,6 @@ Status StressTest::RollbackTxn(Transaction* txn) { delete txn; return s; } -#endif void StressTest::OperateDb(ThreadState* thread) { ReadOptions read_opts(FLAGS_verify_checksum, true); @@ -879,7 +864,6 @@ void StressTest::OperateDb(ThreadState* thread) { } } -#ifndef ROCKSDB_LITE // Verify GetLiveFiles with a 1 in N chance. if (thread->rand.OneInOpt(FLAGS_get_live_files_one_in) && !FLAGS_write_fault_one_in) { @@ -906,7 +890,6 @@ void StressTest::OperateDb(ThreadState* thread) { status); } } -#endif // !ROCKSDB_LITE if (thread->rand.OneInOpt(FLAGS_pause_background_one_in)) { Status status = TestPauseBackground(thread); @@ -916,7 +899,6 @@ void StressTest::OperateDb(ThreadState* thread) { } } -#ifndef ROCKSDB_LITE if (thread->rand.OneInOpt(FLAGS_verify_checksum_one_in)) { Status status = db_->VerifyChecksum(); if (!status.ok()) { @@ -927,7 +909,6 @@ void StressTest::OperateDb(ThreadState* thread) { if (thread->rand.OneInOpt(FLAGS_get_property_one_in)) { TestGetProperty(thread); } -#endif std::vector rand_keys = GenerateKeys(rand_key); @@ -963,7 +944,6 @@ void StressTest::OperateDb(ThreadState* thread) { } } -#ifndef ROCKSDB_LITE if (thread->rand.OneInOpt(FLAGS_approximate_size_one_in)) { Status s = TestApproximateSize(thread, i, rand_column_families, rand_keys); @@ -971,7 +951,6 @@ void StressTest::OperateDb(ThreadState* thread) { VerificationAbort(shared, "ApproximateSize Failed", s); } } -#endif // !ROCKSDB_LITE if (thread->rand.OneInOpt(FLAGS_acquire_snapshot_one_in)) { TestAcquireSnapshot(thread, rand_column_family, keystr, i); } @@ -1069,7 +1048,6 @@ void StressTest::OperateDb(ThreadState* thread) { thread->stats.Stop(); } -#ifndef ROCKSDB_LITE // Generated a list of keys that close to boundaries of SST keys. // If there isn't any SST file in the DB, return empty list. std::vector StressTest::GetWhiteBoxKeys(ThreadState* thread, @@ -1128,7 +1106,6 @@ std::vector StressTest::GetWhiteBoxKeys(ThreadState* thread, } return ret; } -#endif // !ROCKSDB_LITE // Given a key K, this creates an iterator which scans to K and then // does a random sequence of Next/Prev operations. @@ -1324,7 +1301,6 @@ Status StressTest::TestIterate(ThreadState* thread, return Status::OK(); } -#ifndef ROCKSDB_LITE // Test the return status of GetLiveFiles. Status StressTest::VerifyGetLiveFiles() const { std::vector live_file; @@ -1343,7 +1319,6 @@ Status StressTest::VerifyGetCurrentWalFile() const { std::unique_ptr cur_wal_file; return db_->GetCurrentWalFile(&cur_wal_file); } -#endif // !ROCKSDB_LITE // Compare the two iterator, iter and cmp_iter are in the same position, // unless iter might be made invalidate or undefined because of @@ -1509,38 +1484,6 @@ void StressTest::VerifyIterator(ThreadState* thread, } } -#ifdef ROCKSDB_LITE -Status StressTest::TestBackupRestore( - ThreadState* /* thread */, - const std::vector& /* rand_column_families */, - const std::vector& /* rand_keys */) { - assert(false); - fprintf(stderr, - "RocksDB lite does not support " - "TestBackupRestore\n"); - std::terminate(); -} - -Status StressTest::TestCheckpoint( - ThreadState* /* thread */, - const std::vector& /* rand_column_families */, - const std::vector& /* rand_keys */) { - assert(false); - fprintf(stderr, - "RocksDB lite does not support " - "TestCheckpoint\n"); - std::terminate(); -} - -void StressTest::TestCompactFiles(ThreadState* /* thread */, - ColumnFamilyHandle* /* column_family */) { - assert(false); - fprintf(stderr, - "RocksDB lite does not support " - "CompactFiles\n"); - std::terminate(); -} -#else // ROCKSDB_LITE Status StressTest::TestBackupRestore( ThreadState* thread, const std::vector& rand_column_families, const std::vector& rand_keys) { @@ -2108,7 +2051,6 @@ void StressTest::TestCompactFiles(ThreadState* thread, } } } -#endif // ROCKSDB_LITE Status StressTest::TestFlush(const std::vector& rand_column_families) { FlushOptions flush_opts; @@ -2145,15 +2087,11 @@ void StressTest::TestAcquireSnapshot(ThreadState* thread, // This `ReadOptions` is for validation purposes. Ignore // `FLAGS_rate_limit_user_ops` to avoid slowing any validation. ReadOptions ropt; -#ifndef ROCKSDB_LITE auto db_impl = static_cast_with_check(db_->GetRootDB()); const bool ww_snapshot = thread->rand.OneIn(10); const Snapshot* snapshot = ww_snapshot ? db_impl->GetSnapshotForWriteConflictBoundary() : db_->GetSnapshot(); -#else - const Snapshot* snapshot = db_->GetSnapshot(); -#endif // !ROCKSDB_LITE ropt.snapshot = snapshot; // Ideally, we want snapshot taking and timestamp generation to be atomic @@ -2359,7 +2297,6 @@ void StressTest::PrintEnv() const { FLAGS_use_txn ? "true" : "false"); if (FLAGS_use_txn) { -#ifndef ROCKSDB_LITE fprintf(stdout, "Two write queues: : %s\n", FLAGS_two_write_queues ? "true" : "false"); fprintf(stdout, "Write policy : %d\n", @@ -2376,13 +2313,10 @@ void StressTest::PrintEnv() const { fprintf(stdout, "last cwb for recovery : %s\n", FLAGS_use_only_the_last_commit_time_batch_for_recovery ? "true" : "false"); -#endif // !ROCKSDB_LITE } -#ifndef ROCKSDB_LITE fprintf(stdout, "Stacked BlobDB : %s\n", FLAGS_use_blob_db ? "true" : "false"); -#endif // !ROCKSDB_LITE fprintf(stdout, "Read only mode : %s\n", FLAGS_read_only ? "true" : "false"); fprintf(stdout, "Atomic flush : %s\n", @@ -2522,11 +2456,7 @@ void StressTest::PrintEnv() const { void StressTest::Open(SharedState* shared) { assert(db_ == nullptr); -#ifndef ROCKSDB_LITE assert(txn_db_ == nullptr); -#else - (void)shared; -#endif if (!InitializeOptionsFromFile(options_)) { InitializeOptionsFromFlags(cache_, filter_policy_, options_); } @@ -2637,10 +2567,8 @@ void StressTest::Open(SharedState* shared) { } options_.listeners.clear(); -#ifndef ROCKSDB_LITE options_.listeners.emplace_back(new DbStressListener( FLAGS_db, options_.db_paths, cf_descriptors, db_stress_listener_env)); -#endif // !ROCKSDB_LITE RegisterAdditionalListeners(); if (!FLAGS_use_txn) { @@ -2685,7 +2613,6 @@ void StressTest::Open(SharedState* shared) { } } while (true) { -#ifndef ROCKSDB_LITE // StackableDB-based BlobDB if (FLAGS_use_blob_db) { blob_db::BlobDBOptions blob_db_options; @@ -2703,7 +2630,6 @@ void StressTest::Open(SharedState* shared) { db_ = blob_db; } } else -#endif // !ROCKSDB_LITE { if (db_preload_finished_.load() && FLAGS_read_only) { s = DB::OpenForReadOnly(DBOptions(options_), FLAGS_db, @@ -2759,7 +2685,6 @@ void StressTest::Open(SharedState* shared) { break; } } else { -#ifndef ROCKSDB_LITE TransactionDBOptions txn_db_options; assert(FLAGS_txn_write_policy <= TxnDBWritePolicy::WRITE_UNPREPARED); txn_db_options.write_policy = @@ -2791,7 +2716,6 @@ void StressTest::Open(SharedState* shared) { db_ = txn_db_; db_aptr_.store(txn_db_, std::memory_order_release); } -#endif } if (!s.ok()) { fprintf(stderr, "Error in opening the DB [%s]\n", s.ToString().c_str()); @@ -2805,7 +2729,6 @@ void StressTest::Open(SharedState* shared) { // transactions, thus just disable secondary instance if we use // transaction. if (s.ok() && FLAGS_test_secondary && !FLAGS_use_txn) { -#ifndef ROCKSDB_LITE Options tmp_opts; // TODO(yanqin) support max_open_files != -1 for secondary instance. tmp_opts.max_open_files = -1; @@ -2815,20 +2738,11 @@ void StressTest::Open(SharedState* shared) { cf_descriptors, &cmp_cfhs_, &cmp_db_); assert(s.ok()); assert(cmp_cfhs_.size() == static_cast(FLAGS_column_families)); -#else - fprintf(stderr, "Secondary is not supported in RocksDBLite\n"); - exit(1); -#endif // !ROCKSDB_LITE } } else { -#ifndef ROCKSDB_LITE DBWithTTL* db_with_ttl; s = DBWithTTL::Open(options_, FLAGS_db, &db_with_ttl, FLAGS_ttl); db_ = db_with_ttl; -#else - fprintf(stderr, "TTL is not supported in RocksDBLite\n"); - exit(1); -#endif } if (FLAGS_preserve_unverified_changes) { @@ -2852,7 +2766,6 @@ void StressTest::Open(SharedState* shared) { } void StressTest::Reopen(ThreadState* thread) { -#ifndef ROCKSDB_LITE // BG jobs in WritePrepared must be canceled first because i) they can access // the db via a callbac ii) they hold on to a snapshot and the upcoming // ::Close would complain about it. @@ -2865,16 +2778,12 @@ void StressTest::Reopen(ThreadState* thread) { bg_canceled = wait; } assert(!write_prepared || bg_canceled); -#else - (void)thread; -#endif for (auto cf : column_families_) { delete cf; } column_families_.clear(); -#ifndef ROCKSDB_LITE if (thread->rand.OneIn(2)) { Status s = db_->Close(); if (!s.ok()) { @@ -2883,12 +2792,8 @@ void StressTest::Reopen(ThreadState* thread) { } assert(s.ok()); } -#endif delete db_; db_ = nullptr; -#ifndef ROCKSDB_LITE - txn_db_ = nullptr; -#endif num_times_reopened_++; auto now = clock_->NowMicros(); @@ -2993,12 +2898,10 @@ void CheckAndSetOptionsForUserTimestamp(Options& options) { fprintf(stderr, "TransactionDB does not support timestamp yet.\n"); exit(1); } -#ifndef ROCKSDB_LITE if (FLAGS_enable_blob_files || FLAGS_use_blob_db) { fprintf(stderr, "BlobDB not supported with timestamp.\n"); exit(1); } -#endif // !ROCKSDB_LITE if (FLAGS_test_cf_consistency || FLAGS_test_batches_snapshots) { fprintf(stderr, "Due to per-key ts-seq ordering constraint, only the (default) " @@ -3013,7 +2916,6 @@ void CheckAndSetOptionsForUserTimestamp(Options& options) { } bool InitializeOptionsFromFile(Options& options) { -#ifndef ROCKSDB_LITE DBOptions db_options; ConfigOptions config_options; config_options.ignore_unknown_options = false; @@ -3032,11 +2934,6 @@ bool InitializeOptionsFromFile(Options& options) { options = Options(db_options, cf_descriptors[0].options); return true; } -#else - (void)options; - fprintf(stderr, "--options_file not supported in lite mode\n"); - exit(1); -#endif //! ROCKSDB_LITE return false; } @@ -3265,21 +3162,13 @@ void InitializeOptionsFromFlags( case kSkipList: // no need to do anything break; -#ifndef ROCKSDB_LITE case kHashSkipList: options.memtable_factory.reset(NewHashSkipListRepFactory(10000)); break; case kVectorRep: options.memtable_factory.reset(new VectorRepFactory()); break; -#else - default: - fprintf(stderr, - "RocksdbLite only supports skip list mem table. Skip " - "--rep_factory\n"); -#endif // ROCKSDB_LITE } - if (FLAGS_use_full_merge_v1) { options.merge_operator = MergeOperators::CreateDeprecatedPutOperator(); } else { diff --git a/db_stress_tool/db_stress_test_base.h b/db_stress_tool/db_stress_test_base.h index f145ca7dc78..83f9bb1f1d0 100644 --- a/db_stress_tool/db_stress_test_base.h +++ b/db_stress_tool/db_stress_test_base.h @@ -51,7 +51,6 @@ class StressTest { Status SetOptions(ThreadState* thread); -#ifndef ROCKSDB_LITE // For transactionsDB, there can be txns prepared but not yet committeed // right before previous stress run crash. // They will be recovered and processed through @@ -69,7 +68,6 @@ class StressTest { Status CommitTxn(Transaction* txn, ThreadState* thread = nullptr); Status RollbackTxn(Transaction* txn); -#endif virtual void MaybeClearOneColumnFamily(ThreadState* /* thread */) {} @@ -139,19 +137,11 @@ class StressTest { return column_families_[column_family_id]; } -#ifndef ROCKSDB_LITE // Generated a list of keys that close to boundaries of SST keys. // If there isn't any SST file in the DB, return empty list. std::vector GetWhiteBoxKeys(ThreadState* thread, DB* db, ColumnFamilyHandle* cfh, size_t num_keys); -#else // !ROCKSDB_LITE - std::vector GetWhiteBoxKeys(ThreadState*, DB*, - ColumnFamilyHandle*, size_t) { - // Not supported in LITE mode. - return {}; - } -#endif // !ROCKSDB_LITE // Given a key K, this creates an iterator which scans to K and then // does a random sequence of Next/Prev operations. @@ -205,7 +195,6 @@ class StressTest { const std::string& keystr, uint64_t i); Status MaybeReleaseSnapshots(ThreadState* thread, uint64_t i); -#ifndef ROCKSDB_LITE Status VerifyGetLiveFiles() const; Status VerifyGetSortedWalFiles() const; Status VerifyGetCurrentWalFile() const; @@ -215,7 +204,6 @@ class StressTest { ThreadState* thread, uint64_t iteration, const std::vector& rand_column_families, const std::vector& rand_keys); -#endif // !ROCKSDB_LITE virtual Status TestCustomOperations( ThreadState* /*thread*/, @@ -247,10 +235,8 @@ class StressTest { virtual void RegisterAdditionalListeners() {} -#ifndef ROCKSDB_LITE virtual void PrepareTxnDbOptions(SharedState* /*shared*/, TransactionDBOptions& /*txn_db_opts*/) {} -#endif // Returns whether the timestamp of read_opts is updated. bool MaybeUseOlderTimestampForPointLookup(ThreadState* thread, @@ -266,9 +252,7 @@ class StressTest { std::shared_ptr compressed_cache_; std::shared_ptr filter_policy_; DB* db_; -#ifndef ROCKSDB_LITE TransactionDB* txn_db_; -#endif // Currently only used in MultiOpsTxnsStressTest std::atomic db_aptr_; diff --git a/db_stress_tool/expected_state.cc b/db_stress_tool/expected_state.cc index d08403b7617..d07c2efb0eb 100644 --- a/db_stress_tool/expected_state.cc +++ b/db_stress_tool/expected_state.cc @@ -254,7 +254,6 @@ Status FileExpectedStateManager::Open() { return s; } -#ifndef ROCKSDB_LITE Status FileExpectedStateManager::SaveAtAndAfter(DB* db) { SequenceNumber seqno = db->GetLatestSequenceNumber(); @@ -322,17 +321,11 @@ Status FileExpectedStateManager::SaveAtAndAfter(DB* db) { } return s; } -#else // ROCKSDB_LITE -Status FileExpectedStateManager::SaveAtAndAfter(DB* /* db */) { - return Status::NotSupported(); -} -#endif // ROCKSDB_LITE bool FileExpectedStateManager::HasHistory() { return saved_seqno_ != kMaxSequenceNumber; } -#ifndef ROCKSDB_LITE namespace { @@ -683,11 +676,6 @@ Status FileExpectedStateManager::Restore(DB* db) { } return s; } -#else // ROCKSDB_LITE -Status FileExpectedStateManager::Restore(DB* /* db */) { - return Status::NotSupported(); -} -#endif // ROCKSDB_LITE Status FileExpectedStateManager::Clean() { std::vector expected_state_dir_children; diff --git a/db_stress_tool/multi_ops_txns_stress.cc b/db_stress_tool/multi_ops_txns_stress.cc index 7db5e894200..3a87f77167d 100644 --- a/db_stress_tool/multi_ops_txns_stress.cc +++ b/db_stress_tool/multi_ops_txns_stress.cc @@ -329,9 +329,7 @@ void MultiOpsTxnsStressTest::FinishInitDb(SharedState* shared) { if (FLAGS_enable_compaction_filter) { // TODO (yanqin) enable compaction filter } -#ifndef ROCKSDB_LITE ProcessRecoveredPreparedTxns(shared); -#endif ReopenAndPreloadDbIfNeeded(shared); // TODO (yanqin) parallelize if key space is large @@ -348,7 +346,6 @@ void MultiOpsTxnsStressTest::FinishInitDb(SharedState* shared) { void MultiOpsTxnsStressTest::ReopenAndPreloadDbIfNeeded(SharedState* shared) { (void)shared; -#ifndef ROCKSDB_LITE bool db_empty = false; { std::unique_ptr iter(db_->NewIterator(ReadOptions())); @@ -369,7 +366,6 @@ void MultiOpsTxnsStressTest::ReopenAndPreloadDbIfNeeded(SharedState* shared) { fflush(stdout); ScanExistingDb(shared, FLAGS_threads); } -#endif // !ROCKSDB_LITE } // Used for point-lookup transaction @@ -477,7 +473,6 @@ Status MultiOpsTxnsStressTest::TestCheckpoint( return Status::OK(); } -#ifndef ROCKSDB_LITE Status MultiOpsTxnsStressTest::TestApproximateSize( ThreadState* thread, uint64_t iteration, const std::vector& rand_column_families, @@ -488,7 +483,6 @@ Status MultiOpsTxnsStressTest::TestApproximateSize( (void)rand_column_families; return Status::OK(); } -#endif // !ROCKSDB_LITE Status MultiOpsTxnsStressTest::TestCustomOperations( ThreadState* thread, const std::vector& rand_column_families) { @@ -529,7 +523,6 @@ void MultiOpsTxnsStressTest::RegisterAdditionalListeners() { options_.listeners.emplace_back(new MultiOpsTxnsStressListener(this)); } -#ifndef ROCKSDB_LITE void MultiOpsTxnsStressTest::PrepareTxnDbOptions( SharedState* /*shared*/, TransactionDBOptions& txn_db_opts) { // MultiOpsTxnStressTest uses SingleDelete to delete secondary keys, thus we @@ -548,19 +541,11 @@ void MultiOpsTxnsStressTest::PrepareTxnDbOptions( return index_id == Record::kSecondaryIndexId; }; } -#endif // !ROCKSDB_LITE Status MultiOpsTxnsStressTest::PrimaryKeyUpdateTxn(ThreadState* thread, uint32_t old_a, uint32_t old_a_pos, uint32_t new_a) { -#ifdef ROCKSDB_LITE - (void)thread; - (void)old_a; - (void)old_a_pos; - (void)new_a; - return Status::NotSupported(); -#else std::string old_pk = Record::EncodePrimaryKey(old_a); std::string new_pk = Record::EncodePrimaryKey(new_a); Transaction* txn = nullptr; @@ -678,20 +663,12 @@ Status MultiOpsTxnsStressTest::PrimaryKeyUpdateTxn(ThreadState* thread, key_gen->Replace(old_a, old_a_pos, new_a); } return s; -#endif // !ROCKSDB_LITE } Status MultiOpsTxnsStressTest::SecondaryKeyUpdateTxn(ThreadState* thread, uint32_t old_c, uint32_t old_c_pos, uint32_t new_c) { -#ifdef ROCKSDB_LITE - (void)thread; - (void)old_c; - (void)old_c_pos; - (void)new_c; - return Status::NotSupported(); -#else Transaction* txn = nullptr; WriteOptions wopts; Status s = NewTxn(wopts, &txn); @@ -885,18 +862,11 @@ Status MultiOpsTxnsStressTest::SecondaryKeyUpdateTxn(ThreadState* thread, } return s; -#endif // !ROCKSDB_LITE } Status MultiOpsTxnsStressTest::UpdatePrimaryIndexValueTxn(ThreadState* thread, uint32_t a, uint32_t b_delta) { -#ifdef ROCKSDB_LITE - (void)thread; - (void)a; - (void)b_delta; - return Status::NotSupported(); -#else std::string pk_str = Record::EncodePrimaryKey(a); Transaction* txn = nullptr; WriteOptions wopts; @@ -974,17 +944,10 @@ Status MultiOpsTxnsStressTest::UpdatePrimaryIndexValueTxn(ThreadState* thread, delete txn; } return s; -#endif // !ROCKSDB_LITE } Status MultiOpsTxnsStressTest::PointLookupTxn(ThreadState* thread, ReadOptions ropts, uint32_t a) { -#ifdef ROCKSDB_LITE - (void)thread; - (void)ropts; - (void)a; - return Status::NotSupported(); -#else std::string pk_str = Record::EncodePrimaryKey(a); // pk may or may not exist PinnableSlice value; @@ -1030,17 +993,10 @@ Status MultiOpsTxnsStressTest::PointLookupTxn(ThreadState* thread, delete txn; } return s; -#endif // !ROCKSDB_LITE } Status MultiOpsTxnsStressTest::RangeScanTxn(ThreadState* thread, ReadOptions ropts, uint32_t c) { -#ifdef ROCKSDB_LITE - (void)thread; - (void)ropts; - (void)c; - return Status::NotSupported(); -#else std::string sk = Record::EncodeSecondaryKey(c); Transaction* txn = nullptr; @@ -1093,7 +1049,6 @@ Status MultiOpsTxnsStressTest::RangeScanTxn(ThreadState* thread, } return s; -#endif // !ROCKSDB_LITE } void MultiOpsTxnsStressTest::VerifyDb(ThreadState* thread) const { @@ -1356,7 +1311,6 @@ uint32_t MultiOpsTxnsStressTest::GenerateNextC(ThreadState* thread) { return key_gen->Allocate(); } -#ifndef ROCKSDB_LITE void MultiOpsTxnsStressTest::ProcessRecoveredPreparedTxnsHelper( Transaction* txn, SharedState*) { thread_local Random rand(static_cast(FLAGS_seed)); @@ -1418,7 +1372,6 @@ void MultiOpsTxnsStressTest::SetupSnapshot( read_opts.snapshot = txn.GetSnapshot(); } } -#endif // !ROCKSDB_LITE std::string MultiOpsTxnsStressTest::KeySpaces::EncodeTo() const { std::string result; @@ -1489,14 +1442,6 @@ MultiOpsTxnsStressTest::KeySpaces MultiOpsTxnsStressTest::ReadKeySpacesDesc( void MultiOpsTxnsStressTest::PreloadDb(SharedState* shared, int threads, uint32_t lb_a, uint32_t ub_a, uint32_t lb_c, uint32_t ub_c) { -#ifdef ROCKSDB_LITE - (void)shared; - (void)threads; - (void)lb_a; - (void)ub_a; - (void)lb_c; - (void)ub_c; -#else key_gen_for_a_.resize(threads); key_gen_for_c_.resize(threads); @@ -1599,7 +1544,6 @@ void MultiOpsTxnsStressTest::PreloadDb(SharedState* shared, int threads, my_seed, low, high, std::move(existing_c_uniqs[i]), std::move(non_existing_c_uniqs[i])); } -#endif // !ROCKSDB_LITE } // Scan an existing, non-empty database. @@ -1739,7 +1683,6 @@ StressTest* CreateMultiOpsTxnsStressTest() { } void CheckAndSetOptionsForMultiOpsTxnStressTest() { -#ifndef ROCKSDB_LITE if (FLAGS_test_batches_snapshots || FLAGS_test_cf_consistency) { fprintf(stderr, "-test_multi_ops_txns is not compatible with " @@ -1798,10 +1741,6 @@ void CheckAndSetOptionsForMultiOpsTxnStressTest() { "-test_multi_ops_txns\n"); exit(1); } -#else - fprintf(stderr, "-test_multi_ops_txns not supported in ROCKSDB_LITE mode\n"); - exit(1); -#endif // !ROCKSDB_LITE } } // namespace ROCKSDB_NAMESPACE diff --git a/db_stress_tool/multi_ops_txns_stress.h b/db_stress_tool/multi_ops_txns_stress.h index 7463d05d744..cd19a264be7 100644 --- a/db_stress_tool/multi_ops_txns_stress.h +++ b/db_stress_tool/multi_ops_txns_stress.h @@ -248,11 +248,9 @@ class MultiOpsTxnsStressTest : public StressTest { const std::vector& rand_column_families, const std::vector& rand_keys) override; -#ifndef ROCKSDB_LITE Status TestApproximateSize(ThreadState* thread, uint64_t iteration, const std::vector& rand_column_families, const std::vector& rand_keys) override; -#endif // !ROCKSDB_LITE Status TestCustomOperations( ThreadState* thread, @@ -260,10 +258,8 @@ class MultiOpsTxnsStressTest : public StressTest { void RegisterAdditionalListeners() override; -#ifndef ROCKSDB_LITE void PrepareTxnDbOptions(SharedState* /*shared*/, TransactionDBOptions& txn_db_opts) override; -#endif // !ROCKSDB_LITE Status PrimaryKeyUpdateTxn(ThreadState* thread, uint32_t old_a, uint32_t old_a_pos, uint32_t new_a); @@ -344,7 +340,6 @@ class MultiOpsTxnsStressTest : public StressTest { uint32_t GenerateNextC(ThreadState* thread); -#ifndef ROCKSDB_LITE // Randomly commit or rollback `txn` void ProcessRecoveredPreparedTxnsHelper(Transaction* txn, SharedState*) override; @@ -363,7 +358,6 @@ class MultiOpsTxnsStressTest : public StressTest { void SetupSnapshot(ThreadState* thread, ReadOptions& read_opts, Transaction& txn, std::shared_ptr& snapshot); -#endif //! ROCKSDB_LITE std::vector> key_gen_for_a_; std::vector> key_gen_for_c_; @@ -414,7 +408,6 @@ class MultiOpsTxnsStressListener : public EventListener { assert(stress_test_); } -#ifndef ROCKSDB_LITE ~MultiOpsTxnsStressListener() override {} void OnFlushCompleted(DB* db, const FlushJobInfo& info) override { @@ -434,7 +427,6 @@ class MultiOpsTxnsStressListener : public EventListener { assert(info.cf_id == 0); stress_test_->VerifyPkSkFast(info.job_id); } -#endif //! ROCKSDB_LITE private: MultiOpsTxnsStressTest* const stress_test_ = nullptr; diff --git a/db_stress_tool/no_batched_ops_stress.cc b/db_stress_tool/no_batched_ops_stress.cc index e96cc78a49a..9fe7b9012d2 100644 --- a/db_stress_tool/no_batched_ops_stress.cc +++ b/db_stress_tool/no_batched_ops_stress.cc @@ -243,7 +243,6 @@ class NonBatchedOpsStressTest : public StressTest { } } -#ifndef ROCKSDB_LITE void ContinuouslyVerifyDb(ThreadState* thread) const override { if (!cmp_db_) { return; @@ -337,9 +336,6 @@ class NonBatchedOpsStressTest : public StressTest { } } } -#else - void ContinuouslyVerifyDb(ThreadState* /*thread*/) const override {} -#endif // ROCKSDB_LITE void MaybeClearOneColumnFamily(ThreadState* thread) override { if (FLAGS_column_families > 1) { @@ -497,7 +493,6 @@ class NonBatchedOpsStressTest : public StressTest { // Create a transaction in order to write some data. The purpose is to // exercise WriteBatchWithIndex::MultiGetFromBatchAndDB. The transaction // will be rolled back once MultiGet returns. -#ifndef ROCKSDB_LITE Transaction* txn = nullptr; if (use_txn) { WriteOptions wo; @@ -510,11 +505,9 @@ class NonBatchedOpsStressTest : public StressTest { std::terminate(); } } -#endif for (size_t i = 0; i < num_keys; ++i) { key_str.emplace_back(Key(rand_keys[i])); keys.emplace_back(key_str.back()); -#ifndef ROCKSDB_LITE if (use_txn) { // With a 1 in 10 probability, insert the just added key in the batch // into the transaction. This will create an overlap with the MultiGet @@ -549,7 +542,6 @@ class NonBatchedOpsStressTest : public StressTest { } } } -#endif } if (!use_txn) { @@ -563,10 +555,8 @@ class NonBatchedOpsStressTest : public StressTest { error_count = fault_fs_guard->GetAndResetErrorCount(); } } else { -#ifndef ROCKSDB_LITE txn->MultiGet(readoptionscopy, cfh, num_keys, keys.data(), values.data(), statuses.data()); -#endif } if (fault_fs_guard && error_count && !SharedState::ignore_read_error) { @@ -603,9 +593,7 @@ class NonBatchedOpsStressTest : public StressTest { std::string value; if (use_txn) { -#ifndef ROCKSDB_LITE tmp_s = txn->Get(readoptionscopy, cfh, keys[i], &value); -#endif // ROCKSDB_LITE } else { tmp_s = db_->Get(readoptionscopy, cfh, keys[i], &value); } @@ -663,9 +651,7 @@ class NonBatchedOpsStressTest : public StressTest { db_->ReleaseSnapshot(readoptionscopy.snapshot); } if (use_txn) { -#ifndef ROCKSDB_LITE RollbackTxn(txn); -#endif } return statuses; } @@ -829,7 +815,6 @@ class NonBatchedOpsStressTest : public StressTest { s = db_->Merge(write_opts, cfh, k, write_ts, v); } } else { -#ifndef ROCKSDB_LITE Transaction* txn; s = NewTxn(write_opts, &txn); if (s.ok()) { @@ -838,7 +823,6 @@ class NonBatchedOpsStressTest : public StressTest { s = CommitTxn(txn, thread); } } -#endif } } else if (FLAGS_use_put_entity_one_in > 0 && (value_base % FLAGS_use_put_entity_one_in) == 0) { @@ -852,7 +836,6 @@ class NonBatchedOpsStressTest : public StressTest { s = db_->Put(write_opts, cfh, k, write_ts, v); } } else { -#ifndef ROCKSDB_LITE Transaction* txn; s = NewTxn(write_opts, &txn); if (s.ok()) { @@ -861,7 +844,6 @@ class NonBatchedOpsStressTest : public StressTest { s = CommitTxn(txn, thread); } } -#endif } } @@ -918,7 +900,6 @@ class NonBatchedOpsStressTest : public StressTest { s = db_->Delete(write_opts, cfh, key, write_ts); } } else { -#ifndef ROCKSDB_LITE Transaction* txn; s = NewTxn(write_opts, &txn); if (s.ok()) { @@ -927,7 +908,6 @@ class NonBatchedOpsStressTest : public StressTest { s = CommitTxn(txn, thread); } } -#endif } shared->Delete(rand_column_family, rand_key, false /* pending */); thread->stats.AddDeletes(1); @@ -955,7 +935,6 @@ class NonBatchedOpsStressTest : public StressTest { s = db_->SingleDelete(write_opts, cfh, key, write_ts); } } else { -#ifndef ROCKSDB_LITE Transaction* txn; s = NewTxn(write_opts, &txn); if (s.ok()) { @@ -964,7 +943,6 @@ class NonBatchedOpsStressTest : public StressTest { s = CommitTxn(txn, thread); } } -#endif } shared->SingleDelete(rand_column_family, rand_key, false /* pending */); thread->stats.AddSingleDeletes(1); @@ -1052,18 +1030,6 @@ class NonBatchedOpsStressTest : public StressTest { return s; } -#ifdef ROCKSDB_LITE - void TestIngestExternalFile( - ThreadState* /* thread */, - const std::vector& /* rand_column_families */, - const std::vector& /* rand_keys */) override { - assert(false); - fprintf(stderr, - "RocksDB lite does not support " - "TestIngestExternalFile\n"); - std::terminate(); - } -#else void TestIngestExternalFile(ThreadState* thread, const std::vector& rand_column_families, const std::vector& rand_keys) override { @@ -1137,7 +1103,6 @@ class NonBatchedOpsStressTest : public StressTest { shared->Put(column_family, keys[i], values[i], false /* pending */); } } -#endif // ROCKSDB_LITE // Given a key K, this creates an iterator which scans the range // [K, K + FLAGS_num_iterations) forward and backward. @@ -1502,7 +1467,6 @@ class NonBatchedOpsStressTest : public StressTest { return true; } -#ifndef ROCKSDB_LITE void PrepareTxnDbOptions(SharedState* shared, TransactionDBOptions& txn_db_opts) override { txn_db_opts.rollback_deletion_type_callback = @@ -1515,7 +1479,6 @@ class NonBatchedOpsStressTest : public StressTest { return !shared->AllowsOverwrite(key_num); }; } -#endif // ROCKSDB_LITE }; StressTest* CreateNonBatchedOpsStressTest() { diff --git a/env/composite_env.cc b/env/composite_env.cc index b93aa9fcbf5..8ddc9a1a6cd 100644 --- a/env/composite_env.cc +++ b/env/composite_env.cc @@ -391,7 +391,6 @@ Status CompositeEnv::NewDirectory(const std::string& name, namespace { static std::unordered_map env_wrapper_type_info = { -#ifndef ROCKSDB_LITE {"target", OptionTypeInfo(0, OptionType::kUnknown, OptionVerificationType::kByName, OptionTypeFlags::kDontSerialize) @@ -433,24 +432,19 @@ static std::unordered_map env_wrapper_type_info = { return target->env->ValidateOptions(db_opts, cf_opts); } })}, -#endif // ROCKSDB_LITE }; static std::unordered_map composite_fs_wrapper_type_info = { -#ifndef ROCKSDB_LITE {"file_system", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByName, OptionTypeFlags::kNone)}, -#endif // ROCKSDB_LITE }; static std::unordered_map composite_clock_wrapper_type_info = { -#ifndef ROCKSDB_LITE {"clock", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByName, OptionTypeFlags::kNone)}, -#endif // ROCKSDB_LITE }; } // namespace @@ -488,7 +482,6 @@ Status CompositeEnvWrapper::PrepareOptions(const ConfigOptions& options) { return Env::PrepareOptions(options); } -#ifndef ROCKSDB_LITE std::string CompositeEnvWrapper::SerializeOptions( const ConfigOptions& config_options, const std::string& header) const { auto options = CompositeEnv::SerializeOptions(config_options, header); @@ -498,7 +491,6 @@ std::string CompositeEnvWrapper::SerializeOptions( } return options; } -#endif // ROCKSDB_LITE EnvWrapper::EnvWrapper(Env* t) : target_(t) { RegisterOptions("", &target_, &env_wrapper_type_info); @@ -519,7 +511,6 @@ Status EnvWrapper::PrepareOptions(const ConfigOptions& options) { return Env::PrepareOptions(options); } -#ifndef ROCKSDB_LITE std::string EnvWrapper::SerializeOptions(const ConfigOptions& config_options, const std::string& header) const { auto parent = Env::SerializeOptions(config_options, ""); @@ -539,6 +530,5 @@ std::string EnvWrapper::SerializeOptions(const ConfigOptions& config_options, return result; } } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/env/composite_env_wrapper.h b/env/composite_env_wrapper.h index 78da6f0ed64..003c50658b1 100644 --- a/env/composite_env_wrapper.h +++ b/env/composite_env_wrapper.h @@ -289,10 +289,8 @@ class CompositeEnvWrapper : public CompositeEnv { const Customizable* Inner() const override { return target_.env; } Status PrepareOptions(const ConfigOptions& options) override; -#ifndef ROCKSDB_LITE std::string SerializeOptions(const ConfigOptions& config_options, const std::string& header) const override; -#endif // ROCKSDB_LITE // Return the target to which this Env forwards all calls Env* env_target() const { return target_.env; } diff --git a/env/env.cc b/env/env.cc index 832dd9509b3..f673ac57dc4 100644 --- a/env/env.cc +++ b/env/env.cc @@ -29,7 +29,6 @@ namespace ROCKSDB_NAMESPACE { namespace { -#ifndef ROCKSDB_LITE static int RegisterBuiltinEnvs(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory(MockEnv::kClassName(), [](const std::string& /*uri*/, @@ -48,15 +47,12 @@ static int RegisterBuiltinEnvs(ObjectLibrary& library, size_t num_types; return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE static void RegisterSystemEnvs() { -#ifndef ROCKSDB_LITE static std::once_flag loaded; std::call_once(loaded, [&]() { RegisterBuiltinEnvs(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE } class LegacySystemClock : public SystemClock { @@ -97,7 +93,6 @@ class LegacySystemClock : public SystemClock { return env_->TimeToString(time); } -#ifndef ROCKSDB_LITE std::string SerializeOptions(const ConfigOptions& /*config_options*/, const std::string& /*prefix*/) const override { // We do not want the LegacySystemClock to appear in the serialized output. @@ -105,7 +100,6 @@ class LegacySystemClock : public SystemClock { // would be part of the Env. As such, do not serialize it here. return ""; } -#endif // ROCKSDB_LITE }; class LegacySequentialFileWrapper : public FSSequentialFile { @@ -605,7 +599,6 @@ class LegacyFileSystemWrapper : public FileSystem { return status_to_io_status(target_->IsDirectory(path, is_dir)); } -#ifndef ROCKSDB_LITE std::string SerializeOptions(const ConfigOptions& /*config_options*/, const std::string& /*prefix*/) const override { // We do not want the LegacyFileSystem to appear in the serialized output. @@ -613,7 +606,6 @@ class LegacyFileSystemWrapper : public FileSystem { // would be part of the Env. As such, do not serialize it here. return ""; } -#endif // ROCKSDB_LITE private: Env* target_; }; @@ -679,13 +671,8 @@ Status Env::CreateFromString(const ConfigOptions& config_options, status = Status::OK(); } else { RegisterSystemEnvs(); -#ifndef ROCKSDB_LITE // First, try to load the Env as a unique object. status = config_options.registry->NewObject(id, &env, &uniq); -#else - status = - Status::NotSupported("Cannot load environment in LITE mode", value); -#endif } if (config_options.ignore_unsupported_options && status.IsNotSupported()) { status = Status::OK(); @@ -1177,11 +1164,9 @@ const std::shared_ptr& Env::GetSystemClock() const { } namespace { static std::unordered_map sc_wrapper_type_info = { -#ifndef ROCKSDB_LITE {"target", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByName, OptionTypeFlags::kDontSerialize)}, -#endif // ROCKSDB_LITE }; } // namespace @@ -1197,7 +1182,6 @@ Status SystemClockWrapper::PrepareOptions(const ConfigOptions& options) { return SystemClock::PrepareOptions(options); } -#ifndef ROCKSDB_LITE std::string SystemClockWrapper::SerializeOptions( const ConfigOptions& config_options, const std::string& header) const { auto parent = SystemClock::SerializeOptions(config_options, ""); @@ -1217,9 +1201,7 @@ std::string SystemClockWrapper::SerializeOptions( return result; } } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE static int RegisterBuiltinSystemClocks(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -1232,7 +1214,6 @@ static int RegisterBuiltinSystemClocks(ObjectLibrary& library, size_t num_types; return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE Status SystemClock::CreateFromString(const ConfigOptions& config_options, const std::string& value, @@ -1242,12 +1223,10 @@ Status SystemClock::CreateFromString(const ConfigOptions& config_options, *result = clock; return Status::OK(); } else { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinSystemClocks(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE return LoadSharedObject(config_options, value, nullptr, result); } diff --git a/env/env_basic_test.cc b/env/env_basic_test.cc index 0f18b321867..11b07509ce9 100644 --- a/env/env_basic_test.cc +++ b/env/env_basic_test.cc @@ -32,7 +32,6 @@ static Env* GetMockEnv() { static std::unique_ptr mock_env(MockEnv::Create(Env::Default())); return mock_env.get(); } -#ifndef ROCKSDB_LITE static Env* NewTestEncryptedEnv(Env* base, const std::string& provider_id) { ConfigOptions config_opts; config_opts.invoke_prepare_options = false; @@ -81,7 +80,6 @@ static Env* GetTestFS() { EXPECT_NE(fs_env, nullptr); return fs_env; } -#endif // ROCKSDB_LITE } // namespace class EnvBasicTestWithParam @@ -111,7 +109,6 @@ INSTANTIATE_TEST_CASE_P(EnvDefault, EnvMoreTestWithParam, INSTANTIATE_TEST_CASE_P(MockEnv, EnvBasicTestWithParam, ::testing::Values(&GetMockEnv)); -#ifndef ROCKSDB_LITE // next statements run env test against default encryption code. INSTANTIATE_TEST_CASE_P(EncryptedEnv, EnvBasicTestWithParam, ::testing::Values(&GetCtrEncryptedEnv)); @@ -148,7 +145,6 @@ INSTANTIATE_TEST_CASE_P(CustomEnv, EnvBasicTestWithParam, INSTANTIATE_TEST_CASE_P(CustomEnv, EnvMoreTestWithParam, ::testing::ValuesIn(GetCustomEnvs())); -#endif // ROCKSDB_LITE TEST_P(EnvBasicTestWithParam, Basics) { uint64_t file_size; diff --git a/env/env_chroot.cc b/env/env_chroot.cc index a64373517f8..5ff32a7e444 100644 --- a/env/env_chroot.cc +++ b/env/env_chroot.cc @@ -3,7 +3,7 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#if !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#if !defined(OS_WIN) #include "env/env_chroot.h" @@ -145,4 +145,4 @@ Env* NewChrootEnv(Env* base_env, const std::string& chroot_dir) { } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#endif // !defined(OS_WIN) diff --git a/env/env_chroot.h b/env/env_chroot.h index 9e5b9a1e95a..9cead1561b9 100644 --- a/env/env_chroot.h +++ b/env/env_chroot.h @@ -5,7 +5,7 @@ #pragma once -#if !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#if !defined(OS_WIN) #include @@ -52,4 +52,4 @@ std::shared_ptr NewChrootFileSystem( } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#endif // !defined(OS_WIN) diff --git a/env/env_encryption.cc b/env/env_encryption.cc index c6b0a257dbf..602c4be09cb 100644 --- a/env/env_encryption.cc +++ b/env/env_encryption.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/env_encryption.h" @@ -25,9 +24,7 @@ #include "util/random.h" #include "util/string_util.h" -#endif namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE std::shared_ptr EncryptionProvider::NewCTRProvider( const std::shared_ptr& cipher) { return std::make_shared(cipher); @@ -1346,6 +1343,5 @@ Status EncryptionProvider::CreateFromString( result); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/env/env_encryption_ctr.h b/env/env_encryption_ctr.h index cfb440c72ac..fab1da1fbf9 100644 --- a/env/env_encryption_ctr.h +++ b/env/env_encryption_ctr.h @@ -5,7 +5,6 @@ #pragma once -#if !defined(ROCKSDB_LITE) #include "rocksdb/env_encryption.h" @@ -113,4 +112,3 @@ Status NewEncryptedFileSystemImpl( } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) diff --git a/env/env_test.cc b/env/env_test.cc index f4e9d50b239..2f748846b8b 100644 --- a/env/env_test.cc +++ b/env/env_test.cc @@ -1107,7 +1107,6 @@ class IoctlFriendlyTmpdir { bool is_supported_ = true; }; -#ifndef ROCKSDB_LITE TEST_F(EnvPosixTest, PositionedAppend) { std::unique_ptr writable_file; EnvOptions options; @@ -1141,7 +1140,6 @@ TEST_F(EnvPosixTest, PositionedAppend) { ASSERT_EQ('a', result[kBlockSize - 1]); ASSERT_EQ('b', result[kBlockSize]); } -#endif // !ROCKSDB_LITE // `GetUniqueId()` temporarily returns zero on Windows. `BlockBasedTable` can // handle a return value of zero but this test case cannot. @@ -1551,7 +1549,6 @@ TEST_F(EnvPosixTest, MultiReadNonAlignedLargeNum) { } } -#ifndef ROCKSDB_LITE TEST_F(EnvPosixTest, NonAlignedDirectIOMultiReadBeyondFileSize) { EnvOptions soptions; soptions.use_direct_reads = true; @@ -1622,7 +1619,6 @@ TEST_F(EnvPosixTest, NonAlignedDirectIOMultiReadBeyondFileSize) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#endif // ROCKSDB_LITE #if defined(ROCKSDB_IOURING_PRESENT) void GenerateFilesAndRequest(Env* env, const std::string& fname, @@ -2470,13 +2466,11 @@ TEST_F(EnvTest, LogvWithInfoLogLevel) { INSTANTIATE_TEST_CASE_P(DefaultEnvWithoutDirectIO, EnvPosixTestWithParam, ::testing::Values(std::pair(Env::Default(), false))); -#if !defined(ROCKSDB_LITE) INSTANTIATE_TEST_CASE_P(DefaultEnvWithDirectIO, EnvPosixTestWithParam, ::testing::Values(std::pair(Env::Default(), true))); -#endif // !defined(ROCKSDB_LITE) -#if !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#if !defined(OS_WIN) static Env* GetChrootEnv() { static std::unique_ptr chroot_env( NewChrootEnv(Env::Default(), test::TmpDir(Env::Default()))); @@ -2488,7 +2482,7 @@ INSTANTIATE_TEST_CASE_P(ChrootEnvWithoutDirectIO, EnvPosixTestWithParam, INSTANTIATE_TEST_CASE_P(ChrootEnvWithDirectIO, EnvPosixTestWithParam, ::testing::Values(std::pair(GetChrootEnv(), true))); -#endif // !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#endif // !defined(OS_WIN) class EnvFSTestWithParam : public ::testing::Test, @@ -2653,7 +2647,6 @@ class CreateEnvTest : public testing::Test { ConfigOptions config_options_; }; -#ifndef ROCKSDB_LITE TEST_F(CreateEnvTest, LoadCTRProvider) { config_options_.invoke_prepare_options = false; std::string CTR = CTREncryptionProvider::kClassName(); @@ -2712,7 +2705,6 @@ TEST_F(CreateEnvTest, LoadROT13Cipher) { ASSERT_NE(cipher, nullptr); ASSERT_STREQ(cipher->Name(), "ROT13"); } -#endif // ROCKSDB_LITE TEST_F(CreateEnvTest, CreateDefaultSystemClock) { std::shared_ptr clock, copy; @@ -2720,15 +2712,12 @@ TEST_F(CreateEnvTest, CreateDefaultSystemClock) { SystemClock::kDefaultName(), &clock)); ASSERT_NE(clock, nullptr); ASSERT_EQ(clock, SystemClock::Default()); -#ifndef ROCKSDB_LITE std::string opts_str = clock->ToString(config_options_); std::string mismatch; ASSERT_OK(SystemClock::CreateFromString(config_options_, opts_str, ©)); ASSERT_TRUE(clock->AreEquivalent(config_options_, copy.get(), &mismatch)); -#endif // ROCKSDB_LITE } -#ifndef ROCKSDB_LITE TEST_F(CreateEnvTest, CreateMockSystemClock) { std::shared_ptr mock, copy; @@ -2943,7 +2932,6 @@ TEST_F(CreateEnvTest, CreateEncryptedFileSystem) { ASSERT_TRUE(fs->AreEquivalent(config_options_, copy.get(), &mismatch)); } -#endif // ROCKSDB_LITE namespace { @@ -3191,17 +3179,14 @@ TEST_F(CreateEnvTest, CreateDefaultEnv) { ASSERT_EQ(env, Env::Default()); ASSERT_EQ(guard, nullptr); -#ifndef ROCKSDB_LITE std::string opt_str = env->ToString(options); ASSERT_OK(Env::CreateFromString(options, opt_str, &env)); ASSERT_EQ(env, Env::Default()); ASSERT_OK(Env::CreateFromString(options, opt_str, &env, &guard)); ASSERT_EQ(env, Env::Default()); ASSERT_EQ(guard, nullptr); -#endif // ROCKSDB_LITE } -#ifndef ROCKSDB_LITE namespace { class WrappedEnv : public EnvWrapper { public: @@ -3353,7 +3338,6 @@ TEST_F(CreateEnvTest, CreateCompositeEnv) { ASSERT_NE(comp->Inner(), nullptr); ASSERT_OK(ValidateOptions(db_opts, cf_opts)); } -#endif // ROCKSDB_LITE // Forward declaration class ReadAsyncFS; diff --git a/env/file_system.cc b/env/file_system.cc index 6517fe00256..f166fd8a00b 100644 --- a/env/file_system.cc +++ b/env/file_system.cc @@ -26,7 +26,6 @@ FileSystem::FileSystem() {} FileSystem::~FileSystem() {} -#ifndef ROCKSDB_LITE static int RegisterBuiltinFileSystems(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -79,7 +78,6 @@ static int RegisterBuiltinFileSystems(ObjectLibrary& library, size_t num_types; return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE Status FileSystem::CreateFromString(const ConfigOptions& config_options, const std::string& value, @@ -89,12 +87,10 @@ Status FileSystem::CreateFromString(const ConfigOptions& config_options, *result = default_fs; return Status::OK(); } else { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinFileSystems(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE return LoadSharedObject(config_options, value, nullptr, result); } } @@ -230,11 +226,9 @@ IOStatus ReadFileToString(FileSystem* fs, const std::string& fname, namespace { static std::unordered_map fs_wrapper_type_info = { -#ifndef ROCKSDB_LITE {"target", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByName, OptionTypeFlags::kDontSerialize)}, -#endif // ROCKSDB_LITE }; } // namespace FileSystemWrapper::FileSystemWrapper(const std::shared_ptr& t) @@ -249,7 +243,6 @@ Status FileSystemWrapper::PrepareOptions(const ConfigOptions& options) { return FileSystem::PrepareOptions(options); } -#ifndef ROCKSDB_LITE std::string FileSystemWrapper::SerializeOptions( const ConfigOptions& config_options, const std::string& header) const { auto parent = FileSystem::SerializeOptions(config_options, ""); @@ -269,7 +262,6 @@ std::string FileSystemWrapper::SerializeOptions( return result; } } -#endif // ROCKSDB_LITE DirFsyncOptions::DirFsyncOptions() { reason = kDefault; } diff --git a/env/fs_posix.cc b/env/fs_posix.cc index e179a421dcd..18f774f1631 100644 --- a/env/fs_posix.cc +++ b/env/fs_posix.cc @@ -168,10 +168,6 @@ class PosixFileSystem : public FileSystem { FILE* file = nullptr; if (options.use_direct_reads && !options.use_mmap_reads) { -#ifdef ROCKSDB_LITE - return IOStatus::IOError(fname, - "Direct I/O not supported in RocksDB lite"); -#endif // !ROCKSDB_LITE #if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS) flags |= O_DIRECT; TEST_SYNC_POINT_CALLBACK("NewSequentialFile:O_DIRECT", &flags); @@ -223,10 +219,6 @@ class PosixFileSystem : public FileSystem { int flags = cloexec_flags(O_RDONLY, &options); if (options.use_direct_reads && !options.use_mmap_reads) { -#ifdef ROCKSDB_LITE - return IOStatus::IOError(fname, - "Direct I/O not supported in RocksDB lite"); -#endif // !ROCKSDB_LITE #if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS) flags |= O_DIRECT; TEST_SYNC_POINT_CALLBACK("NewRandomAccessFile:O_DIRECT", &flags); @@ -300,10 +292,6 @@ class PosixFileSystem : public FileSystem { // appends data to the end of the file, regardless of the value of // offset. // More info here: https://linux.die.net/man/2/pwrite -#ifdef ROCKSDB_LITE - return IOStatus::IOError(fname, - "Direct I/O not supported in RocksDB lite"); -#endif // ROCKSDB_LITE flags |= O_WRONLY; #if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS) flags |= O_DIRECT; @@ -392,10 +380,6 @@ class PosixFileSystem : public FileSystem { int flags = 0; // Direct IO mode with O_DIRECT flag or F_NOCAHCE (MAC OSX) if (options.use_direct_writes && !options.use_mmap_writes) { -#ifdef ROCKSDB_LITE - return IOStatus::IOError(fname, - "Direct I/O not supported in RocksDB lite"); -#endif // !ROCKSDB_LITE flags |= O_WRONLY; #if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS) flags |= O_DIRECT; @@ -1278,7 +1262,6 @@ std::shared_ptr FileSystem::Default() { return instance; } -#ifndef ROCKSDB_LITE static FactoryFunc posix_filesystem_reg = ObjectLibrary::Default()->AddFactory( ObjectLibrary::PatternEntry("posix").AddSeparator("://", false), @@ -1287,7 +1270,6 @@ static FactoryFunc posix_filesystem_reg = f->reset(new PosixFileSystem()); return f->get(); }); -#endif } // namespace ROCKSDB_NAMESPACE diff --git a/env/fs_readonly.h b/env/fs_readonly.h index 1bbe607849c..7a04aea0801 100644 --- a/env/fs_readonly.h +++ b/env/fs_readonly.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include "rocksdb/file_system.h" @@ -104,4 +103,3 @@ class ReadOnlyFileSystem : public FileSystemWrapper { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/env/fs_remap.cc b/env/fs_remap.cc index fd92411814b..b9832e6cba3 100644 --- a/env/fs_remap.cc +++ b/env/fs_remap.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "env/fs_remap.h" @@ -340,4 +339,3 @@ IOStatus RemapFileSystem::GetAbsolutePath(const std::string& db_path, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/env/fs_remap.h b/env/fs_remap.h index 1f6e061fd6f..a3c998262c0 100644 --- a/env/fs_remap.h +++ b/env/fs_remap.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -136,4 +135,3 @@ class RemapFileSystem : public FileSystemWrapper { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/env/mock_env.cc b/env/mock_env.cc index bfa7dc2f47e..a4e0c43f139 100644 --- a/env/mock_env.cc +++ b/env/mock_env.cc @@ -33,7 +33,6 @@ int64_t MaybeCurrentTime(const std::shared_ptr& clock) { } static std::unordered_map time_elapse_type_info = { -#ifndef ROCKSDB_LITE {"time_elapse_only_sleep", {0, OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kCompareNever, @@ -50,10 +49,8 @@ static std::unordered_map time_elapse_type_info = { return Status::OK(); }, nullptr}}, -#endif // ROCKSDB_LITE }; static std::unordered_map mock_sleep_type_info = { -#ifndef ROCKSDB_LITE {"mock_sleep", {0, OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kCompareNever, @@ -70,7 +67,6 @@ static std::unordered_map mock_sleep_type_info = { return Status::OK(); }, nullptr}}, -#endif // ROCKSDB_LITE }; } // namespace @@ -572,11 +568,9 @@ class TestMemLogger : public Logger { }; static std::unordered_map mock_fs_type_info = { -#ifndef ROCKSDB_LITE {"supports_direct_io", {0, OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; } // namespace @@ -1057,14 +1051,8 @@ Status MockEnv::CorruptBuffer(const std::string& fname) { return mock->CorruptBuffer(fname); } -#ifndef ROCKSDB_LITE // This is to maintain the behavior before swithcing from InMemoryEnv to MockEnv Env* NewMemEnv(Env* base_env) { return MockEnv::Create(base_env); } -#else // ROCKSDB_LITE - -Env* NewMemEnv(Env* /*base_env*/) { return nullptr; } - -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/examples/optimistic_transaction_example.cc b/examples/optimistic_transaction_example.cc index fb0514a694a..07957273724 100644 --- a/examples/optimistic_transaction_example.cc +++ b/examples/optimistic_transaction_example.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/db.h" #include "rocksdb/options.h" @@ -189,4 +188,3 @@ int main() { return 0; } -#endif // ROCKSDB_LITE diff --git a/examples/transaction_example.cc b/examples/transaction_example.cc index 08bcca1b690..541b13f796e 100644 --- a/examples/transaction_example.cc +++ b/examples/transaction_example.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/db.h" #include "rocksdb/options.h" @@ -195,4 +194,3 @@ int main() { return 0; } -#endif // ROCKSDB_LITE diff --git a/file/delete_scheduler.cc b/file/delete_scheduler.cc index b97a0f224d5..8a2d1615d05 100644 --- a/file/delete_scheduler.cc +++ b/file/delete_scheduler.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "file/delete_scheduler.h" @@ -408,4 +407,3 @@ void DeleteScheduler::MaybeCreateBackgroundThread() { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/file/delete_scheduler.h b/file/delete_scheduler.h index 2904ec62186..da3735aed81 100644 --- a/file/delete_scheduler.h +++ b/file/delete_scheduler.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -146,4 +145,3 @@ class DeleteScheduler { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/file/delete_scheduler_test.cc b/file/delete_scheduler_test.cc index d825da32a28..74982dbee42 100644 --- a/file/delete_scheduler_test.cc +++ b/file/delete_scheduler_test.cc @@ -18,7 +18,6 @@ #include "test_util/testharness.h" #include "util/string_util.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { @@ -716,9 +715,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -int main(int /*argc*/, char** /*argv*/) { - printf("DeleteScheduler is not supported in ROCKSDB_LITE\n"); - return 0; -} -#endif // ROCKSDB_LITE diff --git a/file/file_util.cc b/file/file_util.cc index 7997d6e11eb..4b36ea1383f 100644 --- a/file/file_util.cc +++ b/file/file_util.cc @@ -116,7 +116,6 @@ IOStatus CreateFile(FileSystem* fs, const std::string& destination, Status DeleteDBFile(const ImmutableDBOptions* db_options, const std::string& fname, const std::string& dir_to_sync, const bool force_bg, const bool force_fg) { -#ifndef ROCKSDB_LITE SstFileManagerImpl* sfm = static_cast(db_options->sst_file_manager.get()); if (sfm && !force_fg) { @@ -124,14 +123,6 @@ Status DeleteDBFile(const ImmutableDBOptions* db_options, } else { return db_options->env->DeleteFile(fname); } -#else - (void)dir_to_sync; - (void)force_bg; - (void)force_fg; - // SstFileManager is not supported in ROCKSDB_LITE - // Delete file immediately - return db_options->env->DeleteFile(fname); -#endif } // requested_checksum_func_name brings the function name of the checksum diff --git a/file/prefetch_test.cc b/file/prefetch_test.cc index 23e7454ed11..20e3a15b3e2 100644 --- a/file/prefetch_test.cc +++ b/file/prefetch_test.cc @@ -207,7 +207,6 @@ TEST_P(PrefetchTest, Basic) { Close(); } -#ifndef ROCKSDB_LITE // This test verifies BlockBasedTableOptions.max_auto_readahead_size is // configured dynamically. TEST_P(PrefetchTest, ConfigureAutoMaxReadaheadSize) { @@ -559,7 +558,6 @@ TEST_P(PrefetchTest, ConfigureNumFilesReadsForReadaheadSize) { SyncPoint::GetInstance()->ClearAllCallBacks(); Close(); } -#endif // !ROCKSDB_LITE // This test verifies the basic functionality of implicit autoreadahead: // - Enable implicit autoreadahead and prefetch only if sequential blocks are @@ -949,7 +947,6 @@ TEST_P(PrefetchTest, PrefetchWhenReseekwithCache) { Close(); } -#ifndef ROCKSDB_LITE // This test verifies the functionality of ReadOptions.adaptive_readahead. TEST_P(PrefetchTest, DBIterLevelReadAhead) { const int kNumKeys = 1000; @@ -1158,7 +1155,6 @@ TEST_P(PrefetchTest, DBIterLevelReadAheadWithAsyncIO) { } Close(); } -#endif //! ROCKSDB_LITE class PrefetchTest1 : public DBTestBase, public ::testing::WithParamInterface { @@ -1189,7 +1185,6 @@ class PrefetchTest1 : public DBTestBase, INSTANTIATE_TEST_CASE_P(PrefetchTest1, PrefetchTest1, ::testing::Bool()); -#ifndef ROCKSDB_LITE // This test verifies the functionality of ReadOptions.adaptive_readahead when // reads are not sequential. TEST_P(PrefetchTest1, NonSequentialReadsWithAdaptiveReadahead) { @@ -1272,7 +1267,6 @@ TEST_P(PrefetchTest1, NonSequentialReadsWithAdaptiveReadahead) { } Close(); } -#endif //! ROCKSDB_LITE // This test verifies the functionality of adaptive_readaheadsize with cache and // if block is found in cache, decrease the readahead_size if @@ -1513,7 +1507,6 @@ TEST_P(PrefetchTest1, SeekParallelizationTest) { extern "C" bool RocksDbIOUringEnable() { return true; } namespace { -#ifndef ROCKSDB_LITE #ifdef GFLAGS const int kMaxArgCount = 100; const size_t kArgBufferSize = 100000; @@ -1538,7 +1531,6 @@ void RunIOTracerParserTool(std::string trace_file) { ASSERT_EQ(0, ROCKSDB_NAMESPACE::io_tracer_parser(argc, argv)); } #endif // GFLAGS -#endif // ROCKSDB_LITE } // namespace // Tests the default implementation of ReadAsync API with PosixFileSystem during @@ -1929,7 +1921,6 @@ TEST_P(PrefetchTest, SeekParallelizationTestWithPosix) { Close(); } -#ifndef ROCKSDB_LITE #ifdef GFLAGS // This test verifies io_tracing with PosixFileSystem during prefetching. TEST_P(PrefetchTest, TraceReadAsyncWithCallbackWrapper) { @@ -2167,7 +2158,6 @@ TEST_F(FilePrefetchBufferTest, NoSyncWithAsyncIO) { ASSERT_EQ(result, async_result); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/file/random_access_file_reader.cc b/file/random_access_file_reader.cc index 030cd8d07a2..226970641da 100644 --- a/file/random_access_file_reader.cc +++ b/file/random_access_file_reader.cc @@ -99,7 +99,6 @@ IOStatus RandomAccessFileReader::Read( auto prev_perf_level = GetPerfLevel(); IOSTATS_TIMER_GUARD(read_nanos); if (use_direct_io()) { -#ifndef ROCKSDB_LITE size_t alignment = file_->GetRequiredBufferAlignment(); size_t aligned_offset = TruncateToPageBoundary(alignment, static_cast(offset)); @@ -165,7 +164,6 @@ IOStatus RandomAccessFileReader::Read( } } *result = Slice(scratch, res_len); -#endif // !ROCKSDB_LITE } else { size_t pos = 0; const char* res_scratch = nullptr; @@ -187,12 +185,10 @@ IOStatus RandomAccessFileReader::Read( } Slice tmp_result; -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif { IOSTATS_CPU_TIMER_GUARD(cpu_read_nanos, clock_); @@ -204,7 +200,6 @@ IOStatus RandomAccessFileReader::Read( io_s = file_->Read(offset + pos, allowed, opts, &tmp_result, scratch + pos, nullptr); } -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = FileOperationInfo::FinishNow(); NotifyOnFileReadFinish(offset + pos, tmp_result.size(), start_ts, @@ -215,7 +210,6 @@ IOStatus RandomAccessFileReader::Read( tmp_result.size(), offset + pos); } } -#endif if (res_scratch == nullptr) { // we can't simply use `scratch` because reads of mmap'd files return // data in a different buffer. @@ -301,7 +295,6 @@ IOStatus RandomAccessFileReader::MultiRead( FSReadRequest* fs_reqs = read_reqs; size_t num_fs_reqs = num_reqs; -#ifndef ROCKSDB_LITE std::vector aligned_reqs; if (use_direct_io()) { // num_reqs is the max possible size, @@ -345,14 +338,11 @@ IOStatus RandomAccessFileReader::MultiRead( fs_reqs = aligned_reqs.data(); num_fs_reqs = aligned_reqs.size(); } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif // ROCKSDB_LITE { IOSTATS_CPU_TIMER_GUARD(cpu_read_nanos, clock_); @@ -384,7 +374,6 @@ IOStatus RandomAccessFileReader::MultiRead( RecordInHistogram(stats_, MULTIGET_IO_BATCH_SIZE, num_fs_reqs); } -#ifndef ROCKSDB_LITE if (use_direct_io()) { // Populate results in the unaligned read requests. size_t aligned_i = 0; @@ -410,10 +399,8 @@ IOStatus RandomAccessFileReader::MultiRead( } } } -#endif // ROCKSDB_LITE for (size_t i = 0; i < num_reqs; ++i) { -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = FileOperationInfo::FinishNow(); NotifyOnFileReadFinish(read_reqs[i].offset, read_reqs[i].result.size(), @@ -425,7 +412,6 @@ IOStatus RandomAccessFileReader::MultiRead( read_reqs[i].offset); } -#endif // ROCKSDB_LITE RecordIOStats(stats_, file_temperature_, is_last_level_, read_reqs[i].result.size()); } @@ -459,11 +445,9 @@ IOStatus RandomAccessFileReader::ReadAsync( ReadAsyncInfo* read_async_info = new ReadAsyncInfo(cb, cb_arg, clock_->NowMicros()); -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { read_async_info->fs_start_ts_ = FileOperationInfo::StartNow(); } -#endif size_t alignment = file_->GetRequiredBufferAlignment(); bool is_aligned = (req.offset & (alignment - 1)) == 0 && @@ -584,7 +568,6 @@ void RandomAccessFileReader::ReadAsyncCallback(const FSReadRequest& req, } else if (!req.status.IsAborted()) { RecordTick(stats_, ASYNC_READ_ERROR_COUNT, 1); } -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = FileOperationInfo::FinishNow(); NotifyOnFileReadFinish(req.offset, req.result.size(), @@ -595,7 +578,6 @@ void RandomAccessFileReader::ReadAsyncCallback(const FSReadRequest& req, NotifyOnIOError(req.status, FileOperationType::kRead, file_name(), req.result.size(), req.offset); } -#endif RecordIOStats(stats_, file_temperature_, is_last_level_, req.result.size()); delete read_async_info; } diff --git a/file/random_access_file_reader.h b/file/random_access_file_reader.h index ea7cfd234f9..50baa0318ea 100644 --- a/file/random_access_file_reader.h +++ b/file/random_access_file_reader.h @@ -46,7 +46,6 @@ bool TryMerge(FSReadRequest* dest, const FSReadRequest& src); // - Updating IO stats. class RandomAccessFileReader { private: -#ifndef ROCKSDB_LITE void NotifyOnFileReadFinish( uint64_t offset, size_t length, const FileOperationInfo::StartTimePoint& start_ts, @@ -77,7 +76,6 @@ class RandomAccessFileReader { io_status.PermitUncheckedError(); } -#endif // ROCKSDB_LITE bool ShouldNotifyListeners() const { return !listeners_.empty(); } @@ -107,9 +105,7 @@ class RandomAccessFileReader { std::function cb_; void* cb_arg_; uint64_t start_time_; -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint fs_start_ts_; -#endif // Below fields stores the parameters passed by caller in case of direct_io. char* user_scratch_; AlignedBuf* user_aligned_buf_; @@ -142,16 +138,12 @@ class RandomAccessFileReader { listeners_(), file_temperature_(file_temperature), is_last_level_(is_last_level) { -#ifndef ROCKSDB_LITE std::for_each(listeners.begin(), listeners.end(), [this](const std::shared_ptr& e) { if (e->ShouldBeNotifiedOnFileIO()) { listeners_.emplace_back(e); } }); -#else // !ROCKSDB_LITE - (void)listeners; -#endif } static IOStatus Create(const std::shared_ptr& fs, diff --git a/file/random_access_file_reader_test.cc b/file/random_access_file_reader_test.cc index ac0e9e57a1f..22e950c7838 100644 --- a/file/random_access_file_reader_test.cc +++ b/file/random_access_file_reader_test.cc @@ -64,7 +64,6 @@ class RandomAccessFileReaderTest : public testing::Test { }; // Skip the following tests in lite mode since direct I/O is unsupported. -#ifndef ROCKSDB_LITE TEST_F(RandomAccessFileReaderTest, ReadDirectIO) { std::string fname = "read-direct-io"; @@ -284,7 +283,6 @@ TEST_F(RandomAccessFileReaderTest, MultiReadDirectIO) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); } -#endif // ROCKSDB_LITE TEST(FSReadRequest, Align) { FSReadRequest r; diff --git a/file/sequence_file_reader.cc b/file/sequence_file_reader.cc index d51d5be46e2..0cc941b3d08 100644 --- a/file/sequence_file_reader.cc +++ b/file/sequence_file_reader.cc @@ -39,7 +39,6 @@ IOStatus SequentialFileReader::Read(size_t n, Slice* result, char* scratch, Env::IOPriority rate_limiter_priority) { IOStatus io_s; if (use_direct_io()) { -#ifndef ROCKSDB_LITE // // |-offset_advance-|---bytes returned--| // |----------------------buf size-------------------------| @@ -95,7 +94,6 @@ IOStatus SequentialFileReader::Read(size_t n, Slice* result, char* scratch, std::min(buf.CurrentSize() - offset_advance, n)); } *result = Slice(scratch, r); -#endif // !ROCKSDB_LITE } else { // To be paranoid, modify scratch a little bit, so in case underlying // FileSystem doesn't fill the buffer but return success and `scratch` @@ -116,22 +114,18 @@ IOStatus SequentialFileReader::Read(size_t n, Slice* result, char* scratch, } else { allowed = n; } -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif Slice tmp; io_s = file_->Read(allowed, IOOptions(), &tmp, scratch + read, nullptr /* dbg */); -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = FileOperationInfo::FinishNow(); size_t offset = offset_.fetch_add(tmp.size()); NotifyOnFileReadFinish(offset, tmp.size(), start_ts, finish_ts, io_s); } -#endif read += tmp.size(); if (!io_s.ok() || tmp.size() < allowed) { break; @@ -144,12 +138,10 @@ IOStatus SequentialFileReader::Read(size_t n, Slice* result, char* scratch, } IOStatus SequentialFileReader::Skip(uint64_t n) { -#ifndef ROCKSDB_LITE if (use_direct_io()) { offset_ += static_cast(n); return IOStatus::OK(); } -#endif // !ROCKSDB_LITE return file_->Skip(n); } diff --git a/file/sequence_file_reader.h b/file/sequence_file_reader.h index baea10eb767..14350e8de42 100644 --- a/file/sequence_file_reader.h +++ b/file/sequence_file_reader.h @@ -23,7 +23,6 @@ namespace ROCKSDB_NAMESPACE { // cache disabled) reads appropriately, and also updates the IO stats. class SequentialFileReader { private: -#ifndef ROCKSDB_LITE void NotifyOnFileReadFinish( uint64_t offset, size_t length, const FileOperationInfo::StartTimePoint& start_ts, @@ -49,7 +48,6 @@ class SequentialFileReader { } }); } -#endif // ROCKSDB_LITE bool ShouldNotifyListeners() const { return !listeners_.empty(); } @@ -70,11 +68,7 @@ class SequentialFileReader { file_(std::move(_file), io_tracer, _file_name), listeners_(), rate_limiter_(rate_limiter) { -#ifndef ROCKSDB_LITE AddFileIOListeners(listeners); -#else - (void)listeners; -#endif } explicit SequentialFileReader( @@ -89,11 +83,7 @@ class SequentialFileReader { io_tracer, _file_name), listeners_(), rate_limiter_(rate_limiter) { -#ifndef ROCKSDB_LITE AddFileIOListeners(listeners); -#else - (void)listeners; -#endif } static IOStatus Create(const std::shared_ptr& fs, const std::string& fname, const FileOptions& file_opts, diff --git a/file/sst_file_manager_impl.cc b/file/sst_file_manager_impl.cc index 7053e6a0738..459ea36cdb5 100644 --- a/file/sst_file_manager_impl.cc +++ b/file/sst_file_manager_impl.cc @@ -18,7 +18,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE SstFileManagerImpl::SstFileManagerImpl( const std::shared_ptr& clock, const std::shared_ptr& fs, @@ -504,22 +503,5 @@ SstFileManager* NewSstFileManager(Env* env, std::shared_ptr fs, return res; } -#else - -SstFileManager* NewSstFileManager(Env* /*env*/, - std::shared_ptr /*info_log*/, - std::string /*trash_dir*/, - int64_t /*rate_bytes_per_sec*/, - bool /*delete_existing_trash*/, - Status* status, double /*max_trash_db_ratio*/, - uint64_t /*bytes_max_delete_chunk*/) { - if (status) { - *status = - Status::NotSupported("SstFileManager is not supported in ROCKSDB_LITE"); - } - return nullptr; -} - -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/file/sst_file_manager_impl.h b/file/sst_file_manager_impl.h index 548eb57f814..e85376e5cea 100644 --- a/file/sst_file_manager_impl.h +++ b/file/sst_file_manager_impl.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -192,4 +191,3 @@ class SstFileManagerImpl : public SstFileManager { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/file/writable_file_writer.cc b/file/writable_file_writer.cc index 3afc51c567b..b60993c6d82 100644 --- a/file/writable_file_writer.cc +++ b/file/writable_file_writer.cc @@ -249,15 +249,12 @@ IOStatus WritableFileWriter::Close() { // we need to let the file know where data ends. if (use_direct_io()) { { -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif uint64_t filesz = filesize_.load(std::memory_order_acquire); interim = writable_file_->Truncate(filesz, io_options, nullptr); -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = FileOperationInfo::FinishNow(); NotifyOnFileTruncateFinish(start_ts, finish_ts, s); @@ -266,18 +263,14 @@ IOStatus WritableFileWriter::Close() { filesz); } } -#endif } if (interim.ok()) { { -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif interim = writable_file_->Fsync(io_options, nullptr); -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = FileOperationInfo::FinishNow(); NotifyOnFileSyncFinish(start_ts, finish_ts, s, @@ -286,7 +279,6 @@ IOStatus WritableFileWriter::Close() { NotifyOnIOError(interim, FileOperationType::kFsync, file_name()); } } -#endif } } if (!interim.ok() && s.ok()) { @@ -296,14 +288,11 @@ IOStatus WritableFileWriter::Close() { TEST_KILL_RANDOM("WritableFileWriter::Close:0"); { -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif interim = writable_file_->Close(io_options, nullptr); -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = FileOperationInfo::FinishNow(); NotifyOnFileCloseFinish(start_ts, finish_ts, s); @@ -311,7 +300,6 @@ IOStatus WritableFileWriter::Close() { NotifyOnIOError(interim, FileOperationType::kClose, file_name()); } } -#endif } if (!interim.ok() && s.ok()) { s = interim; @@ -344,7 +332,6 @@ IOStatus WritableFileWriter::Flush(Env::IOPriority op_rate_limiter_priority) { if (buf_.CurrentSize() > 0) { if (use_direct_io()) { -#ifndef ROCKSDB_LITE if (pending_sync_) { if (perform_data_verification_ && buffered_data_with_checksum_) { s = WriteDirectWithChecksum(op_rate_limiter_priority); @@ -352,7 +339,6 @@ IOStatus WritableFileWriter::Flush(Env::IOPriority op_rate_limiter_priority) { s = WriteDirect(op_rate_limiter_priority); } } -#endif // !ROCKSDB_LITE } else { if (perform_data_verification_ && buffered_data_with_checksum_) { s = WriteBufferedWithChecksum(buf_.BufferStart(), buf_.CurrentSize(), @@ -369,18 +355,15 @@ IOStatus WritableFileWriter::Flush(Env::IOPriority op_rate_limiter_priority) { } { -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif IOOptions io_options; io_options.rate_limiter_priority = WritableFileWriter::DecideRateLimiterPriority( writable_file_->GetIOPriority(), op_rate_limiter_priority); s = writable_file_->Flush(io_options, nullptr); -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = std::chrono::steady_clock::now(); NotifyOnFileFlushFinish(start_ts, finish_ts, s); @@ -388,7 +371,6 @@ IOStatus WritableFileWriter::Flush(Env::IOPriority op_rate_limiter_priority) { NotifyOnIOError(s, FileOperationType::kFlush, file_name()); } } -#endif } if (!s.ok()) { @@ -500,12 +482,10 @@ IOStatus WritableFileWriter::SyncInternal(bool use_fsync) { IOSTATS_CPU_TIMER_GUARD(cpu_write_nanos, clock_); -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif IOOptions io_options; io_options.rate_limiter_priority = writable_file_->GetIOPriority(); @@ -514,7 +494,6 @@ IOStatus WritableFileWriter::SyncInternal(bool use_fsync) { } else { s = writable_file_->Sync(io_options, nullptr); } -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = std::chrono::steady_clock::now(); NotifyOnFileSyncFinish( @@ -526,7 +505,6 @@ IOStatus WritableFileWriter::SyncInternal(bool use_fsync) { file_name()); } } -#endif SetPerfLevel(prev_perf_level); // The caller will be responsible to call set_seen_error() if s is not OK. @@ -540,19 +518,16 @@ IOStatus WritableFileWriter::RangeSync(uint64_t offset, uint64_t nbytes) { IOSTATS_TIMER_GUARD(range_sync_nanos); TEST_SYNC_POINT("WritableFileWriter::RangeSync:0"); -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); } -#endif IOOptions io_options; io_options.rate_limiter_priority = writable_file_->GetIOPriority(); IOStatus s = writable_file_->RangeSync(offset, nbytes, io_options, nullptr); if (!s.ok()) { set_seen_error(); } -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = std::chrono::steady_clock::now(); NotifyOnFileRangeSyncFinish(offset, nbytes, start_ts, finish_ts, s); @@ -561,7 +536,6 @@ IOStatus WritableFileWriter::RangeSync(uint64_t offset, uint64_t nbytes) { offset); } } -#endif return s; } @@ -598,14 +572,12 @@ IOStatus WritableFileWriter::WriteBuffered( IOSTATS_TIMER_GUARD(write_nanos); TEST_SYNC_POINT("WritableFileWriter::Flush:BeforeAppend"); -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; uint64_t old_size = writable_file_->GetFileSize(io_options, nullptr); if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); old_size = next_write_offset_; } -#endif { auto prev_perf_level = GetPerfLevel(); @@ -633,7 +605,6 @@ IOStatus WritableFileWriter::WriteBuffered( } SetPerfLevel(prev_perf_level); } -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = std::chrono::steady_clock::now(); NotifyOnFileWriteFinish(old_size, allowed, start_ts, finish_ts, s); @@ -642,7 +613,6 @@ IOStatus WritableFileWriter::WriteBuffered( old_size); } } -#endif if (!s.ok()) { set_seen_error(); return s; @@ -702,14 +672,12 @@ IOStatus WritableFileWriter::WriteBufferedWithChecksum( IOSTATS_TIMER_GUARD(write_nanos); TEST_SYNC_POINT("WritableFileWriter::Flush:BeforeAppend"); -#ifndef ROCKSDB_LITE FileOperationInfo::StartTimePoint start_ts; uint64_t old_size = writable_file_->GetFileSize(io_options, nullptr); if (ShouldNotifyListeners()) { start_ts = FileOperationInfo::StartNow(); old_size = next_write_offset_; } -#endif { auto prev_perf_level = GetPerfLevel(); @@ -720,7 +688,6 @@ IOStatus WritableFileWriter::WriteBufferedWithChecksum( s = writable_file_->Append(Slice(src, left), io_options, v_info, nullptr); SetPerfLevel(prev_perf_level); } -#ifndef ROCKSDB_LITE if (ShouldNotifyListeners()) { auto finish_ts = std::chrono::steady_clock::now(); NotifyOnFileWriteFinish(old_size, left, start_ts, finish_ts, s); @@ -729,7 +696,6 @@ IOStatus WritableFileWriter::WriteBufferedWithChecksum( old_size); } } -#endif if (!s.ok()) { // If writable_file_->Append() failed, then the data may or may not // exist in the underlying memory buffer, OS page cache, remote file @@ -789,7 +755,6 @@ void WritableFileWriter::Crc32cHandoffChecksumCalculation(const char* data, // whole number of pages to be written again on the next flush because we can // only write on aligned // offsets. -#ifndef ROCKSDB_LITE IOStatus WritableFileWriter::WriteDirect( Env::IOPriority op_rate_limiter_priority) { if (seen_error()) { @@ -1006,7 +971,6 @@ IOStatus WritableFileWriter::WriteDirectWithChecksum( } return s; } -#endif // !ROCKSDB_LITE Env::IOPriority WritableFileWriter::DecideRateLimiterPriority( Env::IOPriority writable_file_io_priority, Env::IOPriority op_rate_limiter_priority) { diff --git a/file/writable_file_writer.h b/file/writable_file_writer.h index b3985eb209a..aac0f59491e 100644 --- a/file/writable_file_writer.h +++ b/file/writable_file_writer.h @@ -35,7 +35,6 @@ class SystemClock; // - Update IO stats. class WritableFileWriter { private: -#ifndef ROCKSDB_LITE void NotifyOnFileWriteFinish( uint64_t offset, size_t length, const FileOperationInfo::StartTimePoint& start_ts, @@ -128,7 +127,6 @@ class WritableFileWriter { } io_error_info.io_status.PermitUncheckedError(); } -#endif // ROCKSDB_LITE bool ShouldNotifyListeners() const { return !listeners_.empty(); } void UpdateFileChecksum(const Slice& data); @@ -144,12 +142,10 @@ class WritableFileWriter { // not counting padding data std::atomic filesize_; std::atomic flushed_size_; -#ifndef ROCKSDB_LITE // This is necessary when we use unbuffered access // and writes must happen on aligned offsets // so we need to go back and write that page again uint64_t next_write_offset_; -#endif // ROCKSDB_LITE bool pending_sync_; std::atomic seen_error_; #ifndef NDEBUG @@ -169,9 +165,7 @@ class WritableFileWriter { bool perform_data_verification_; uint32_t buffered_data_crc32c_checksum_; bool buffered_data_with_checksum_; -#ifndef ROCKSDB_LITE Temperature temperature_; -#endif // ROCKSDB_LITE public: WritableFileWriter( @@ -190,9 +184,7 @@ class WritableFileWriter { max_buffer_size_(options.writable_file_max_buffer_size), filesize_(0), flushed_size_(0), -#ifndef ROCKSDB_LITE next_write_offset_(0), -#endif // ROCKSDB_LITE pending_sync_(false), seen_error_(false), last_sync_size_(0), @@ -205,24 +197,18 @@ class WritableFileWriter { perform_data_verification_(perform_data_verification), buffered_data_crc32c_checksum_(0), buffered_data_with_checksum_(buffered_data_with_checksum) { -#ifndef ROCKSDB_LITE temperature_ = options.temperature; -#endif // ROCKSDB_LITE assert(!use_direct_io() || max_buffer_size_ > 0); TEST_SYNC_POINT_CALLBACK("WritableFileWriter::WritableFileWriter:0", reinterpret_cast(max_buffer_size_)); buf_.Alignment(writable_file_->GetRequiredBufferAlignment()); buf_.AllocateNewBuffer(std::min((size_t)65536, max_buffer_size_)); -#ifndef ROCKSDB_LITE std::for_each(listeners.begin(), listeners.end(), [this](const std::shared_ptr& e) { if (e->ShouldBeNotifiedOnFileIO()) { listeners_.emplace_back(e); } }); -#else // !ROCKSDB_LITE - (void)listeners; -#endif if (file_checksum_gen_factory != nullptr) { FileChecksumGenContext checksum_gen_context; checksum_gen_context.file_name = _file_name; @@ -321,10 +307,8 @@ class WritableFileWriter { // Used when os buffering is OFF and we are writing // DMA such as in Direct I/O mode -#ifndef ROCKSDB_LITE IOStatus WriteDirect(Env::IOPriority op_rate_limiter_priority); IOStatus WriteDirectWithChecksum(Env::IOPriority op_rate_limiter_priority); -#endif // !ROCKSDB_LITE // Normal write. IOStatus WriteBuffered(const char* data, size_t size, Env::IOPriority op_rate_limiter_priority); diff --git a/include/rocksdb/advanced_options.h b/include/rocksdb/advanced_options.h index 258cf82a105..b0bfd551d32 100644 --- a/include/rocksdb/advanced_options.h +++ b/include/rocksdb/advanced_options.h @@ -27,14 +27,11 @@ enum CompactionStyle : char { // level based compaction style kCompactionStyleLevel = 0x0, // Universal compaction style - // Not supported in ROCKSDB_LITE. kCompactionStyleUniversal = 0x1, // FIFO compaction style - // Not supported in ROCKSDB_LITE kCompactionStyleFIFO = 0x2, // Disable background compaction. Compaction jobs are submitted // via CompactFiles(). - // Not supported in ROCKSDB_LITE kCompactionStyleNone = 0x3, }; @@ -753,7 +750,7 @@ struct AdvancedColumnFamilyOptions { // Related options that were originally here but now moved include: // no_block_cache // block_cache - // block_cache_compressed + // block_cache_compressed (removed) // block_size // block_size_deviation // block_restart_interval diff --git a/include/rocksdb/configurable.h b/include/rocksdb/configurable.h index 60ae89f9710..a200d7e86ca 100644 --- a/include/rocksdb/configurable.h +++ b/include/rocksdb/configurable.h @@ -49,10 +49,8 @@ class Configurable { std::string name; // Pointer to the object being registered void* opt_ptr; -#ifndef ROCKSDB_LITE // The map of options being registered const std::unordered_map* type_map; -#endif }; public: @@ -121,7 +119,6 @@ class Configurable { const std::unordered_map& opt_map, std::unordered_map* unused); -#ifndef ROCKSDB_LITE // Updates the named option to the input value, returning OK if successful. // Note that ConfigureOption does not cause PrepareOptions to be invoked. // @param config_options Controls how the name/value is processed. @@ -135,7 +132,6 @@ class Configurable { // @return InvalidArgument If the value cannot be successfully parsed. Status ConfigureOption(const ConfigOptions& config_options, const std::string& name, const std::string& value); -#endif // ROCKSDB_LITE // Configures the options for this class based on the input parameters. // On successful completion, the object is updated with the settings from @@ -171,7 +167,6 @@ class Configurable { // serialized. Status GetOptionString(const ConfigOptions& config_options, std::string* result) const; -#ifndef ROCKSDB_LITE // Returns the serialized options for this object. // This method is similar to GetOptionString with no errors. // @param config_options Controls how serialization happens. @@ -202,7 +197,6 @@ class Configurable { // its value cannot be serialized. virtual Status GetOption(const ConfigOptions& config_options, const std::string& name, std::string* value) const; -#endif // ROCKSDB_LITE // Checks to see if this Configurable is equivalent to other. // This method assumes that the two objects are of the same class. @@ -317,7 +311,6 @@ class Configurable { const std::unordered_map& opts_map, std::unordered_map* unused); -#ifndef ROCKSDB_LITE // Method that configures a the specific opt_name from opt_value. // By default, this method calls opt_info.ParseOption with the // input parameters. @@ -348,13 +341,10 @@ class Configurable { const void* const this_ptr, const void* const that_ptr, std::string* bad_name) const; -#endif -#ifndef ROCKSDB_LITE // Internal method to serialize options (ToString) // Classes may override this value to change its behavior. virtual std::string SerializeOptions(const ConfigOptions& config_options, const std::string& header) const; -#endif // ROCKSDB_LITE // Given a name (e.g. rocksdb.my.type.opt), returns the short name (opt) virtual std::string GetOptionName(const std::string& long_name) const; diff --git a/include/rocksdb/convenience.h b/include/rocksdb/convenience.h index 921ec221beb..fb740c6fc11 100644 --- a/include/rocksdb/convenience.h +++ b/include/rocksdb/convenience.h @@ -90,10 +90,8 @@ struct ConfigOptions { // The environment to use for this option Env* env = Env::Default(); -#ifndef ROCKSDB_LITE // The object registry to use for this options std::shared_ptr registry; -#endif bool IsShallow() const { return depth == Depth::kDepthShallow; } bool IsDetailed() const { return depth == Depth::kDepthDetailed; } @@ -107,7 +105,6 @@ struct ConfigOptions { } }; -#ifndef ROCKSDB_LITE // The following set of functions provide a way to construct RocksDB Options // from a string or a string-to-string map. Here is the general rule of @@ -520,6 +517,5 @@ Status VerifySstFileChecksum(const Options& options, const ReadOptions& read_options, const std::string& file_path, const SequenceNumber& largest_seqno = 0); -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/include/rocksdb/customizable.h b/include/rocksdb/customizable.h index 92f7504ae1b..076aca65909 100644 --- a/include/rocksdb/customizable.h +++ b/include/rocksdb/customizable.h @@ -157,12 +157,10 @@ class Customizable : public Configurable { bool AreEquivalent(const ConfigOptions& config_options, const Configurable* other, std::string* mismatch) const override; -#ifndef ROCKSDB_LITE // Gets the value of the option associated with the input name // @see Configurable::GetOption for more details Status GetOption(const ConfigOptions& config_options, const std::string& name, std::string* value) const override; -#endif // ROCKSDB_LITE // Helper method for getting for parsing the opt_value into the corresponding // options for use in potentially creating a new Customizable object (this // method is primarily a support method for LoadSharedObject et al for new @@ -224,10 +222,8 @@ class Customizable : public Configurable { virtual const char* NickName() const { return ""; } // Given a name (e.g. rocksdb.my.type.opt), returns the short name (opt) std::string GetOptionName(const std::string& long_name) const override; -#ifndef ROCKSDB_LITE std::string SerializeOptions(const ConfigOptions& options, const std::string& prefix) const override; -#endif // ROCKSDB_LITE }; } // namespace ROCKSDB_NAMESPACE diff --git a/include/rocksdb/db.h b/include/rocksdb/db.h index cad3d1c3c81..a5973b47920 100644 --- a/include/rocksdb/db.h +++ b/include/rocksdb/db.h @@ -53,20 +53,13 @@ struct Options; struct ReadOptions; struct TableProperties; struct WriteOptions; -#ifdef ROCKSDB_LITE -class CompactionJobInfo; -#endif class Env; class EventListener; class FileSystem; -#ifndef ROCKSDB_LITE class Replayer; -#endif class StatsHistoryIterator; -#ifndef ROCKSDB_LITE class TraceReader; class TraceWriter; -#endif class WriteBatch; extern const std::string kDefaultColumnFamilyName; @@ -197,8 +190,6 @@ class DB { // Open the database for read only. // - // Not supported in ROCKSDB_LITE, in which case the function will - // return Status::NotSupported. static Status OpenForReadOnly(const Options& options, const std::string& name, DB** dbptr, bool error_if_wal_file_exists = false); @@ -210,8 +201,6 @@ class DB { // to specify default column family. The default column family name is // 'default' and it's stored in ROCKSDB_NAMESPACE::kDefaultColumnFamilyName // - // Not supported in ROCKSDB_LITE, in which case the function will - // return Status::NotSupported. static Status OpenForReadOnly( const DBOptions& db_options, const std::string& name, const std::vector& column_families, @@ -849,7 +838,6 @@ class DB { // use "snapshot" after this call. virtual void ReleaseSnapshot(const Snapshot* snapshot) = 0; -#ifndef ROCKSDB_LITE // Contains all valid property arguments for GetProperty() or // GetMapProperty(). Each is a "string" property for retrieval with // GetProperty() unless noted as a "map" property, for GetMapProperty(). @@ -1115,7 +1103,6 @@ class DB { // entries being pinned in blob cache. static const std::string kBlobCachePinnedUsage; }; -#endif /* ROCKSDB_LITE */ // DB implementations export properties about their state via this method. // If "property" is a valid "string" property understood by this DB @@ -1490,7 +1477,6 @@ class DB { // threads call EnableFileDeletions() virtual Status EnableFileDeletions(bool force = true) = 0; -#ifndef ROCKSDB_LITE // Retrieves the creation time of the oldest file in the DB. // This API only works if max_open_files = -1, if it is not then // Status returned is Status::NotSupported() @@ -1690,7 +1676,6 @@ class DB { virtual Status VerifyChecksum() { return VerifyChecksum(ReadOptions()); } -#endif // ROCKSDB_LITE // Returns the unique ID which is read from IDENTITY file during the opening // of database by setting in the identity variable @@ -1707,7 +1692,6 @@ class DB { // Returns default column family handle virtual ColumnFamilyHandle* DefaultColumnFamily() const = 0; -#ifndef ROCKSDB_LITE virtual Status GetPropertiesOfAllTables(ColumnFamilyHandle* column_family, TablePropertiesCollection* props) = 0; @@ -1774,7 +1758,6 @@ class DB { return Status::NotSupported("NewDefaultReplayer() is not implemented."); } -#endif // ROCKSDB_LITE // Needed for StackableDB virtual DB* GetRootDB() { return this; } @@ -1788,7 +1771,6 @@ class DB { return Status::NotSupported("GetStatsHistory() is not implemented."); } -#ifndef ROCKSDB_LITE // Make the secondary instance catch up with the primary by tailing and // replaying the MANIFEST and WAL of the primary. // Column families created by the primary after the secondary instance starts @@ -1802,7 +1784,6 @@ class DB { virtual Status TryCatchUpWithPrimary() { return Status::NotSupported("Supported only by secondary instance"); } -#endif // !ROCKSDB_LITE }; // Overloaded operators for enum class SizeApproximationFlags. @@ -1837,7 +1818,6 @@ Status DestroyDB(const std::string& name, const Options& options, const std::vector& column_families = std::vector()); -#ifndef ROCKSDB_LITE // If a DB cannot be opened, you may attempt to call this method to // resurrect as much of the contents of the database as possible. // Some data may be lost, so be careful when calling this function @@ -1860,6 +1840,5 @@ Status RepairDB(const std::string& dbname, const DBOptions& db_options, // families encountered during the repair Status RepairDB(const std::string& dbname, const Options& options); -#endif } // namespace ROCKSDB_NAMESPACE diff --git a/include/rocksdb/db_dump_tool.h b/include/rocksdb/db_dump_tool.h index b7d4766a2f0..2c97bad7557 100644 --- a/include/rocksdb/db_dump_tool.h +++ b/include/rocksdb/db_dump_tool.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -42,4 +41,3 @@ class DbUndumpTool { ROCKSDB_NAMESPACE::Options options = ROCKSDB_NAMESPACE::Options()); }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index 789e2bfb45e..1b6273d7758 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -1649,10 +1649,8 @@ class EnvWrapper : public Env { target_.env->SanitizeEnvOptions(env_opts); } Status PrepareOptions(const ConfigOptions& options) override; -#ifndef ROCKSDB_LITE std::string SerializeOptions(const ConfigOptions& config_options, const std::string& header) const override; -#endif // ROCKSDB_LITE private: Target target_; diff --git a/include/rocksdb/env_encryption.h b/include/rocksdb/env_encryption.h index 282db6ed413..3ddb1a75581 100644 --- a/include/rocksdb/env_encryption.h +++ b/include/rocksdb/env_encryption.h @@ -5,7 +5,6 @@ #pragma once -#if !defined(ROCKSDB_LITE) #include @@ -462,4 +461,3 @@ class EncryptedFileSystem : public FileSystemWrapper { }; } // namespace ROCKSDB_NAMESPACE -#endif // !defined(ROCKSDB_LITE) diff --git a/include/rocksdb/file_system.h b/include/rocksdb/file_system.h index b7d185c527c..77f9e2dfad8 100644 --- a/include/rocksdb/file_system.h +++ b/include/rocksdb/file_system.h @@ -1510,10 +1510,8 @@ class FileSystemWrapper : public FileSystem { const Customizable* Inner() const override { return target_.get(); } Status PrepareOptions(const ConfigOptions& options) override; -#ifndef ROCKSDB_LITE std::string SerializeOptions(const ConfigOptions& config_options, const std::string& header) const override; -#endif // ROCKSDB_LITE virtual IOStatus Poll(std::vector& io_handles, size_t min_completions) override { diff --git a/include/rocksdb/ldb_tool.h b/include/rocksdb/ldb_tool.h index 7408cbc8738..b8f2e222fa8 100644 --- a/include/rocksdb/ldb_tool.h +++ b/include/rocksdb/ldb_tool.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -41,4 +40,3 @@ class LDBTool { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/listener.h b/include/rocksdb/listener.h index 853b587581b..e1f97fa1bbd 100644 --- a/include/rocksdb/listener.h +++ b/include/rocksdb/listener.h @@ -210,7 +210,6 @@ struct WriteStallInfo { } condition; }; -#ifndef ROCKSDB_LITE struct FileDeletionInfo { FileDeletionInfo() = default; @@ -843,11 +842,5 @@ class EventListener : public Customizable { ~EventListener() override {} }; -#else - -class EventListener {}; -struct FlushJobInfo {}; - -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/include/rocksdb/memtablerep.h b/include/rocksdb/memtablerep.h index cb5444dca35..be0f6cd1f18 100644 --- a/include/rocksdb/memtablerep.h +++ b/include/rocksdb/memtablerep.h @@ -359,7 +359,6 @@ class SkipListFactory : public MemTableRepFactory { size_t lookahead_; }; -#ifndef ROCKSDB_LITE // This creates MemTableReps that are backed by an std::vector. On iteration, // the vector is sorted. This is useful for workloads where iteration is very // rare and writes are generally not issued after reads begin. @@ -419,5 +418,4 @@ extern MemTableRepFactory* NewHashLinkListRepFactory( bool if_log_bucket_dist_when_flash = true, uint32_t threshold_use_skiplist = 256); -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 9f2b5b13804..78e26de559b 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -82,7 +82,6 @@ struct ColumnFamilyOptions : public AdvancedColumnFamilyOptions { // Use this if you don't need to keep the data sorted, i.e. you'll never use // an iterator, only Put() and Get() API calls // - // Not supported in ROCKSDB_LITE ColumnFamilyOptions* OptimizeForPointLookup(uint64_t block_cache_size_mb); // Default values for some parameters in ColumnFamilyOptions are not @@ -99,8 +98,6 @@ struct ColumnFamilyOptions : public AdvancedColumnFamilyOptions { // biggest performance gains. // Note: we might use more memory than memtable_memory_budget during high // write rate period - // - // OptimizeUniversalStyleCompaction is not supported in ROCKSDB_LITE ColumnFamilyOptions* OptimizeLevelStyleCompaction( uint64_t memtable_memory_budget = 512 * 1024 * 1024); ColumnFamilyOptions* OptimizeUniversalStyleCompaction( @@ -464,14 +461,12 @@ struct DBOptions { // memtable to cost to DBOptions* OptimizeForSmallDb(std::shared_ptr* cache = nullptr); -#ifndef ROCKSDB_LITE // By default, RocksDB uses only one background thread for flush and // compaction. Calling this function will set it up such that total of // `total_threads` is used. Good value for `total_threads` is the number of // cores. You almost definitely want to call this function if your system is // bottlenecked by RocksDB. DBOptions* IncreaseParallelism(int total_threads = 16); -#endif // ROCKSDB_LITE // If true, the database will be created if it is missing. // Default: false @@ -762,7 +757,6 @@ struct DBOptions { // If specified with non-zero value, log file will be rolled // if it has been active longer than `log_file_time_to_roll`. // Default: 0 (disabled) - // Not supported in ROCKSDB_LITE mode! size_t log_file_time_to_roll = 0; // Maximal info log files to be kept. @@ -837,12 +831,10 @@ struct DBOptions { // Use O_DIRECT for user and compaction reads. // Default: false - // Not supported in ROCKSDB_LITE mode! bool use_direct_reads = false; // Use O_DIRECT for writes in background flush and compactions. // Default: false - // Not supported in ROCKSDB_LITE mode! bool use_direct_io_for_flush_and_compaction = false; // If false, fallocate() calls are bypassed, which disables file @@ -1165,17 +1157,14 @@ struct DBOptions { // A global cache for table-level rows. // Default: nullptr (disabled) - // Not supported in ROCKSDB_LITE mode! std::shared_ptr row_cache = nullptr; -#ifndef ROCKSDB_LITE // A filter object supplied to be invoked while processing write-ahead-logs // (WALs) during recovery. The filter provides a way to inspect log // records, ignoring a particular record or skipping replay. // The filter is invoked at startup and is invoked from a single-thread // currently. WalFilter* wal_filter = nullptr; -#endif // ROCKSDB_LITE // If true, then DB::Open / CreateColumnFamily / DropColumnFamily // SetOptions will fail if options file is not properly persisted. @@ -1551,7 +1540,6 @@ struct ReadOptions { // added data) and is optimized for sequential reads. It will return records // that were inserted into the database after the creation of the iterator. // Default: false - // Not supported in ROCKSDB_LITE mode! bool tailing; // This options is not used anymore. It was to turn on a functionality that @@ -1569,8 +1557,6 @@ struct ReadOptions { // When true, by default use total_order_seek = true, and RocksDB can // selectively enable prefix seek mode if won't generate a different result // from total_order_seek, based on seek key, and iterator upper bound. - // Not supported in ROCKSDB_LITE mode, in the way that even with value true - // prefix mode is not used. // BUG: Using Comparator::IsSameLengthImmediateSuccessor and // SliceTransform::FullLengthEnabled to enable prefix mode in cases where // prefix of upper bound differs from prefix of seek key has a flaw. @@ -2103,7 +2089,6 @@ struct OpenAndCompactOptions { std::atomic* canceled = nullptr; }; -#ifndef ROCKSDB_LITE struct LiveFilesStorageInfoOptions { // Whether to populate FileStorageInfo::file_checksum* or leave blank bool include_checksum_info = false; @@ -2112,6 +2097,5 @@ struct LiveFilesStorageInfoOptions { // Default: always force a flush without checking sizes. uint64_t wal_size_for_flush = 0; }; -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/include/rocksdb/sst_dump_tool.h b/include/rocksdb/sst_dump_tool.h index 9261ba47d0d..0b81833f7d5 100644 --- a/include/rocksdb/sst_dump_tool.h +++ b/include/rocksdb/sst_dump_tool.h @@ -2,7 +2,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #pragma once #include "rocksdb/options.h" @@ -16,4 +15,3 @@ class SSTDumpTool { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/sst_file_reader.h b/include/rocksdb/sst_file_reader.h index 4b864248097..026ae66d036 100644 --- a/include/rocksdb/sst_file_reader.h +++ b/include/rocksdb/sst_file_reader.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include "rocksdb/iterator.h" #include "rocksdb/options.h" @@ -44,4 +43,3 @@ class SstFileReader { } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/include/rocksdb/sst_file_writer.h b/include/rocksdb/sst_file_writer.h index c85f097a517..a56c46b3980 100644 --- a/include/rocksdb/sst_file_writer.h +++ b/include/rocksdb/sst_file_writer.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -171,4 +170,3 @@ class SstFileWriter { }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/include/rocksdb/statistics.h b/include/rocksdb/statistics.h index 2e4f4e6c422..b9e027b60f0 100644 --- a/include/rocksdb/statistics.h +++ b/include/rocksdb/statistics.h @@ -627,9 +627,7 @@ class Statistics : public Customizable { // Resets all ticker and histogram stats virtual Status Reset() { return Status::NotSupported("Not implemented"); } -#ifndef ROCKSDB_LITE using Customizable::ToString; -#endif // ROCKSDB_LITE // String representation of the statistic object. Must be thread-safe. virtual std::string ToString() const { // Do nothing by default diff --git a/include/rocksdb/system_clock.h b/include/rocksdb/system_clock.h index 486183d60e6..7ca92e54e34 100644 --- a/include/rocksdb/system_clock.h +++ b/include/rocksdb/system_clock.h @@ -103,10 +103,8 @@ class SystemClockWrapper : public SystemClock { } Status PrepareOptions(const ConfigOptions& options) override; -#ifndef ROCKSDB_LITE std::string SerializeOptions(const ConfigOptions& config_options, const std::string& header) const override; -#endif // ROCKSDB_LITE const Customizable* Inner() const override { return target_.get(); } protected: diff --git a/include/rocksdb/table.h b/include/rocksdb/table.h index 587c305c34a..9d7e3d3b88a 100644 --- a/include/rocksdb/table.h +++ b/include/rocksdb/table.h @@ -671,7 +671,6 @@ struct BlockBasedTablePropertyNames { extern TableFactory* NewBlockBasedTableFactory( const BlockBasedTableOptions& table_options = BlockBasedTableOptions()); -#ifndef ROCKSDB_LITE enum EncodingType : char { // Always write full keys without any special encoding. @@ -828,7 +827,6 @@ struct CuckooTableOptions { extern TableFactory* NewCuckooTableFactory( const CuckooTableOptions& table_options = CuckooTableOptions()); -#endif // ROCKSDB_LITE class RandomAccessFileReader; @@ -910,7 +908,6 @@ class TableFactory : public Customizable { virtual bool IsDeleteRangeSupported() const { return false; } }; -#ifndef ROCKSDB_LITE // Create a special table factory that can open either of the supported // table formats, based on setting inside the SST files. It should be used to // convert a DB from one table format to another. @@ -926,6 +923,5 @@ extern TableFactory* NewAdaptiveTableFactory( std::shared_ptr plain_table_factory = nullptr, std::shared_ptr cuckoo_table_factory = nullptr); -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/include/rocksdb/thread_status.h b/include/rocksdb/thread_status.h index 1b5f8c04632..f37e45f9783 100644 --- a/include/rocksdb/thread_status.h +++ b/include/rocksdb/thread_status.h @@ -22,7 +22,7 @@ #include "rocksdb/rocksdb_namespace.h" -#if !defined(ROCKSDB_LITE) && !defined(NROCKSDB_THREAD_STATUS) +#if !defined(NROCKSDB_THREAD_STATUS) #define ROCKSDB_USING_THREAD_STATUS #endif diff --git a/include/rocksdb/utilities/backup_engine.h b/include/rocksdb/utilities/backup_engine.h index 892c9493240..204d12d6fea 100644 --- a/include/rocksdb/utilities/backup_engine.h +++ b/include/rocksdb/utilities/backup_engine.h @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -688,4 +687,3 @@ class BackupEngineReadOnly : public BackupEngineReadOnlyBase { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/cache_dump_load.h b/include/rocksdb/utilities/cache_dump_load.h index fde03db7e68..8b91bb7e15b 100644 --- a/include/rocksdb/utilities/cache_dump_load.h +++ b/include/rocksdb/utilities/cache_dump_load.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -139,4 +138,3 @@ Status NewDefaultCacheDumpedLoader( std::unique_ptr* cache_dump_loader); } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/checkpoint.h b/include/rocksdb/utilities/checkpoint.h index 6046513aba4..6509f38d969 100644 --- a/include/rocksdb/utilities/checkpoint.h +++ b/include/rocksdb/utilities/checkpoint.h @@ -6,7 +6,6 @@ // A checkpoint is an openable snapshot of a database at a point in time. #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -62,4 +61,3 @@ class Checkpoint { }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/include/rocksdb/utilities/customizable_util.h b/include/rocksdb/utilities/customizable_util.h index 62240763b5b..b530eba6e5a 100644 --- a/include/rocksdb/utilities/customizable_util.h +++ b/include/rocksdb/utilities/customizable_util.h @@ -69,11 +69,7 @@ static Status NewSharedObject( std::shared_ptr* result) { if (!id.empty()) { Status status; -#ifndef ROCKSDB_LITE status = config_options.registry->NewSharedObject(id, result); -#else - status = Status::NotSupported("Cannot load object in LITE mode ", id); -#endif // ROCKSDB_LITE if (config_options.ignore_unsupported_options && status.IsNotSupported()) { status = Status::OK(); } else if (status.ok()) { @@ -123,16 +119,10 @@ static Status NewManagedObject( std::shared_ptr* result) { Status status; if (!id.empty()) { -#ifndef ROCKSDB_LITE status = config_options.registry->GetOrCreateManagedObject( id, result, [config_options, opt_map](T* object) { return object->ConfigureFromMap(config_options, opt_map); }); -#else - (void)result; - (void)opt_map; - status = Status::NotSupported("Cannot load object in LITE mode ", id); -#endif // ROCKSDB_LITE if (config_options.ignore_unsupported_options && status.IsNotSupported()) { return Status::OK(); } @@ -254,11 +244,7 @@ static Status NewUniqueObject( std::unique_ptr* result) { if (!id.empty()) { Status status; -#ifndef ROCKSDB_LITE status = config_options.registry->NewUniqueObject(id, result); -#else - status = Status::NotSupported("Cannot load object in LITE mode ", id); -#endif // ROCKSDB_LITE if (config_options.ignore_unsupported_options && status.IsNotSupported()) { status = Status::OK(); } else if (status.ok()) { @@ -325,11 +311,7 @@ static Status NewStaticObject( const std::unordered_map& opt_map, T** result) { if (!id.empty()) { Status status; -#ifndef ROCKSDB_LITE status = config_options.registry->NewStaticObject(id, result); -#else - status = Status::NotSupported("Cannot load object in LITE mode ", id); -#endif // ROCKSDB_LITE if (config_options.ignore_unsupported_options && status.IsNotSupported()) { status = Status::OK(); } else if (status.ok()) { diff --git a/include/rocksdb/utilities/db_ttl.h b/include/rocksdb/utilities/db_ttl.h index d57e7473ad9..12f5cbac0f7 100644 --- a/include/rocksdb/utilities/db_ttl.h +++ b/include/rocksdb/utilities/db_ttl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -69,4 +68,3 @@ class DBWithTTL : public StackableDB { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/debug.h b/include/rocksdb/utilities/debug.h index 0e05265573c..e1fc76e3e0e 100644 --- a/include/rocksdb/utilities/debug.h +++ b/include/rocksdb/utilities/debug.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include "rocksdb/db.h" #include "rocksdb/types.h" @@ -45,4 +44,3 @@ Status GetAllKeyVersions(DB* db, ColumnFamilyHandle* cfh, Slice begin_key, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/env_mirror.h b/include/rocksdb/utilities/env_mirror.h index ffde5effad0..2a126128708 100644 --- a/include/rocksdb/utilities/env_mirror.h +++ b/include/rocksdb/utilities/env_mirror.h @@ -18,7 +18,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -178,4 +177,3 @@ class EnvMirror : public EnvWrapper { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/ldb_cmd.h b/include/rocksdb/utilities/ldb_cmd.h index 00763819257..af5ee4ba989 100644 --- a/include/rocksdb/utilities/ldb_cmd.h +++ b/include/rocksdb/utilities/ldb_cmd.h @@ -5,7 +5,6 @@ // #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -315,4 +314,3 @@ class LDBCommandRunner { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/memory_util.h b/include/rocksdb/utilities/memory_util.h index 4f1606b5194..b141b4ef0e8 100644 --- a/include/rocksdb/utilities/memory_util.h +++ b/include/rocksdb/utilities/memory_util.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #pragma once @@ -47,4 +46,3 @@ class MemoryUtil { std::map* usage_by_type); }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/include/rocksdb/utilities/object_registry.h b/include/rocksdb/utilities/object_registry.h index 3bafb837c8a..613ef1cd9b0 100644 --- a/include/rocksdb/utilities/object_registry.h +++ b/include/rocksdb/utilities/object_registry.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -582,4 +581,3 @@ class ObjectRegistry { mutable std::mutex library_mutex_; // Mutex for managed libraries }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/optimistic_transaction_db.h b/include/rocksdb/utilities/optimistic_transaction_db.h index c070e49a309..261883782ff 100644 --- a/include/rocksdb/utilities/optimistic_transaction_db.h +++ b/include/rocksdb/utilities/optimistic_transaction_db.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -97,4 +96,3 @@ class OptimisticTransactionDB : public StackableDB { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/options_util.h b/include/rocksdb/utilities/options_util.h index 6062a798def..840363f1b63 100644 --- a/include/rocksdb/utilities/options_util.h +++ b/include/rocksdb/utilities/options_util.h @@ -6,7 +6,6 @@ // This file contains utility functions for RocksDB Options. #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -103,4 +102,3 @@ Status CheckOptionsCompatibility( const std::vector& cf_descs); } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/include/rocksdb/utilities/replayer.h b/include/rocksdb/utilities/replayer.h index 4fdd8d73a7a..fc5319989bc 100644 --- a/include/rocksdb/utilities/replayer.h +++ b/include/rocksdb/utilities/replayer.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -84,4 +83,3 @@ class Replayer { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/stackable_db.h b/include/rocksdb/utilities/stackable_db.h index 9b13c3bdf42..356ea08d9c4 100644 --- a/include/rocksdb/utilities/stackable_db.h +++ b/include/rocksdb/utilities/stackable_db.h @@ -376,7 +376,6 @@ class StackableDB : public DB { virtual Status UnlockWAL() override { return db_->UnlockWAL(); } -#ifndef ROCKSDB_LITE virtual Status DisableFileDeletions() override { return db_->DisableFileDeletions(); @@ -448,7 +447,6 @@ class StackableDB : public DB { return db_->NewDefaultReplayer(handles, std::move(reader), replayer); } -#endif // ROCKSDB_LITE virtual Status GetLiveFiles(std::vector& vec, uint64_t* mfs, bool flush_memtable = true) override { @@ -552,11 +550,9 @@ class StackableDB : public DB { return db_->DefaultColumnFamily(); } -#ifndef ROCKSDB_LITE Status TryCatchUpWithPrimary() override { return db_->TryCatchUpWithPrimary(); } -#endif // ROCKSDB_LITE protected: DB* db_; diff --git a/include/rocksdb/utilities/table_properties_collectors.h b/include/rocksdb/utilities/table_properties_collectors.h index f3a4ba0052f..f9d8d5dcdd7 100644 --- a/include/rocksdb/utilities/table_properties_collectors.h +++ b/include/rocksdb/utilities/table_properties_collectors.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -87,4 +86,3 @@ NewCompactOnDeletionCollectorFactory(size_t sliding_window_size, double deletion_ratio = 0); } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/include/rocksdb/utilities/transaction.h b/include/rocksdb/utilities/transaction.h index 1d2822988fc..91c088a60ad 100644 --- a/include/rocksdb/utilities/transaction.h +++ b/include/rocksdb/utilities/transaction.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -683,4 +682,3 @@ class Transaction { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/transaction_db.h b/include/rocksdb/utilities/transaction_db.h index 741c5957474..3c4b63068e6 100644 --- a/include/rocksdb/utilities/transaction_db.h +++ b/include/rocksdb/utilities/transaction_db.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -505,4 +504,3 @@ class TransactionDB : public StackableDB { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/transaction_db_mutex.h b/include/rocksdb/utilities/transaction_db_mutex.h index e352f325a02..4ef566dad92 100644 --- a/include/rocksdb/utilities/transaction_db_mutex.h +++ b/include/rocksdb/utilities/transaction_db_mutex.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -88,4 +87,3 @@ class TransactionDBMutexFactory { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/include/rocksdb/utilities/write_batch_with_index.h b/include/rocksdb/utilities/write_batch_with_index.h index 84dc11a312c..d5867567ba8 100644 --- a/include/rocksdb/utilities/write_batch_with_index.h +++ b/include/rocksdb/utilities/write_batch_with_index.h @@ -10,7 +10,6 @@ // inserted. #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -306,4 +305,3 @@ class WriteBatchWithIndex : public WriteBatchBase { } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/java/src/main/java/org/rocksdb/ReadOptions.java b/java/src/main/java/org/rocksdb/ReadOptions.java index 0836f0f1843..c638b17b744 100755 --- a/java/src/main/java/org/rocksdb/ReadOptions.java +++ b/java/src/main/java/org/rocksdb/ReadOptions.java @@ -163,9 +163,6 @@ public ReadOptions setReadTier(final ReadTier readTier) { * added data) and is optimized for sequential reads. It will return records * that were inserted into the database after the creation of the iterator. * Default: false - * - * Not supported in {@code ROCKSDB_LITE} mode! - * * @return true if tailing iterator is enabled. */ public boolean tailing() { @@ -179,7 +176,6 @@ public boolean tailing() { * added data) and is optimized for sequential reads. It will return records * that were inserted into the database after the creation of the iterator. * Default: false - * Not supported in ROCKSDB_LITE mode! * * @param tailing if true, then tailing iterator will be enabled. * @return the reference to the current ReadOptions. @@ -537,8 +533,6 @@ public ReadOptions setTableFilter(final AbstractTableFilter tableFilter) { * When true, by default use total_order_seek = true, and RocksDB can * selectively enable prefix seek mode if won't generate a different result * from total_order_seek, based on seek key, and iterator upper bound. - * Not supported in ROCKSDB_LITE mode, in the way that even with value true - * prefix mode is not used. * Default: false * * @return true if auto prefix mode is set. @@ -553,8 +547,6 @@ public boolean autoPrefixMode() { * When true, by default use total_order_seek = true, and RocksDB can * selectively enable prefix seek mode if won't generate a different result * from total_order_seek, based on seek key, and iterator upper bound. - * Not supported in ROCKSDB_LITE mode, in the way that even with value true - * prefix mode is not used. * Default: false * @param mode auto prefix mode * @return the reference to the current ReadOptions. diff --git a/logging/auto_roll_logger.cc b/logging/auto_roll_logger.cc index fe095847912..9e9ad45aee0 100644 --- a/logging/auto_roll_logger.cc +++ b/logging/auto_roll_logger.cc @@ -16,7 +16,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE // -- AutoRollLogger AutoRollLogger::AutoRollLogger(const std::shared_ptr& fs, @@ -269,7 +268,6 @@ bool AutoRollLogger::LogExpired() { ++cached_now_access_count; return cached_now >= ctime_ + kLogFileTimeToRoll; } -#endif // !ROCKSDB_LITE Status CreateLoggerFromOptions(const std::string& dbname, const DBOptions& options, @@ -312,7 +310,6 @@ Status CreateLoggerFromOptions(const std::string& dbname, return s; } } -#ifndef ROCKSDB_LITE // Currently we only support roll by time-to-roll and log size if (options.log_file_time_to_roll > 0 || options.max_log_file_size > 0) { AutoRollLogger* result = new AutoRollLogger( @@ -327,7 +324,6 @@ Status CreateLoggerFromOptions(const std::string& dbname, } return s; } -#endif // !ROCKSDB_LITE // Open a log file in the same directory as the db s = env->FileExists(fname); if (s.ok()) { diff --git a/logging/auto_roll_logger.h b/logging/auto_roll_logger.h index 805925e5a8a..dca9996fea0 100644 --- a/logging/auto_roll_logger.h +++ b/logging/auto_roll_logger.h @@ -21,7 +21,6 @@ namespace ROCKSDB_NAMESPACE { class FileSystem; class SystemClock; -#ifndef ROCKSDB_LITE // Rolls the log file by size and/or time class AutoRollLogger : public Logger { public: @@ -158,7 +157,6 @@ class AutoRollLogger : public Logger { IODebugContext io_context_; mutable port::Mutex mutex_; }; -#endif // !ROCKSDB_LITE // Facade to craete logger automatically Status CreateLoggerFromOptions(const std::string& dbname, diff --git a/logging/auto_roll_logger_test.cc b/logging/auto_roll_logger_test.cc index 8e94a78c824..3d0ec1763f2 100644 --- a/logging/auto_roll_logger_test.cc +++ b/logging/auto_roll_logger_test.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "logging/auto_roll_logger.h" @@ -730,13 +729,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as AutoRollLogger is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/memory/jemalloc_nodump_allocator.cc b/memory/jemalloc_nodump_allocator.cc index 62ee661d2ea..cdad14576d2 100644 --- a/memory/jemalloc_nodump_allocator.cc +++ b/memory/jemalloc_nodump_allocator.cc @@ -23,7 +23,6 @@ std::atomic JemallocNodumpAllocator::original_alloc_{nullptr}; #endif // ROCKSDB_JEMALLOC_NODUMP_ALLOCATOR static std::unordered_map 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 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 34dce9bb66d..d0de26b94d5 100644 --- a/memory/memory_allocator.cc +++ b/memory/memory_allocator.cc @@ -15,13 +15,10 @@ namespace ROCKSDB_NAMESPACE { namespace { static std::unordered_map ma_wrapper_type_info = { -#ifndef ROCKSDB_LITE {"target", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByName, OptionTypeFlags::kNone)}, -#endif // ROCKSDB_LITE }; -#ifndef ROCKSDB_LITE static int RegisterBuiltinAllocators(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -61,7 +58,6 @@ static int RegisterBuiltinAllocators(ObjectLibrary& library, size_t num_types; return static_cast(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* 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(copy, value, result); diff --git a/memory/memory_allocator_test.cc b/memory/memory_allocator_test.cc index 6afde7165c9..6616e1c3bd9 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 diff --git a/memtable/hash_linklist_rep.cc b/memtable/hash_linklist_rep.cc index a717683048c..9e60f9be378 100644 --- a/memtable/hash_linklist_rep.cc +++ b/memtable/hash_linklist_rep.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include #include @@ -923,4 +922,3 @@ MemTableRepFactory* NewHashLinkListRepFactory( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/memtable/hash_skiplist_rep.cc b/memtable/hash_skiplist_rep.cc index 9d093829ba8..15ff4f0719b 100644 --- a/memtable/hash_skiplist_rep.cc +++ b/memtable/hash_skiplist_rep.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include #include "db/memtable.h" @@ -390,4 +389,3 @@ MemTableRepFactory* NewHashSkipListRepFactory( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/memtable/memtablerep_bench.cc b/memtable/memtablerep_bench.cc index a915abed786..83db461581b 100644 --- a/memtable/memtablerep_bench.cc +++ b/memtable/memtablerep_bench.cc @@ -579,7 +579,6 @@ int main(int argc, char** argv) { std::unique_ptr factory; if (FLAGS_memtablerep == "skiplist") { factory.reset(new ROCKSDB_NAMESPACE::SkipListFactory); -#ifndef ROCKSDB_LITE } else if (FLAGS_memtablerep == "vector") { factory.reset(new ROCKSDB_NAMESPACE::VectorRepFactory); } else if (FLAGS_memtablerep == "hashskiplist" || @@ -597,7 +596,6 @@ int main(int argc, char** argv) { FLAGS_if_log_bucket_dist_when_flash, FLAGS_threshold_use_skiplist)); options.prefix_extractor.reset( ROCKSDB_NAMESPACE::NewFixedPrefixTransform(FLAGS_prefix_length)); -#endif // ROCKSDB_LITE } else { ROCKSDB_NAMESPACE::ConfigOptions config_options; config_options.ignore_unsupported_options = false; diff --git a/memtable/skiplistrep.cc b/memtable/skiplistrep.cc index 40f13a2c17d..c3b4c785d38 100644 --- a/memtable/skiplistrep.cc +++ b/memtable/skiplistrep.cc @@ -341,11 +341,9 @@ class SkipListRep : public MemTableRep { } // namespace static std::unordered_map skiplist_factory_info = { -#ifndef ROCKSDB_LITE {"lookahead", {0, OptionType::kSizeT, OptionVerificationType::kNormal, OptionTypeFlags::kDontSerialize /*Since it is part of the ID*/}}, -#endif }; SkipListFactory::SkipListFactory(size_t lookahead) : lookahead_(lookahead) { diff --git a/memtable/vectorrep.cc b/memtable/vectorrep.cc index 29316334999..e42ae4439c8 100644 --- a/memtable/vectorrep.cc +++ b/memtable/vectorrep.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include #include #include @@ -306,4 +305,3 @@ MemTableRep* VectorRepFactory::CreateMemTableRep( return new VectorRep(compare, allocator, count_); } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/memtable/write_buffer_manager.cc b/memtable/write_buffer_manager.cc index 8db9816bef7..d2cfd3487b0 100644 --- a/memtable/write_buffer_manager.cc +++ b/memtable/write_buffer_manager.cc @@ -28,7 +28,6 @@ WriteBufferManager::WriteBufferManager(size_t _buffer_size, cache_res_mgr_(nullptr), allow_stall_(allow_stall), stall_active_(false) { -#ifndef ROCKSDB_LITE if (cache) { // Memtable's memory usage tends to fluctuate frequently // therefore we set delayed_decrease = true to save some dummy entry @@ -37,9 +36,6 @@ WriteBufferManager::WriteBufferManager(size_t _buffer_size, CacheReservationManagerImpl>( cache, true /* delayed_decrease */); } -#else - (void)cache; -#endif // ROCKSDB_LITE } WriteBufferManager::~WriteBufferManager() { @@ -70,7 +66,6 @@ void WriteBufferManager::ReserveMem(size_t mem) { // Should only be called from write thread void WriteBufferManager::ReserveMemWithCache(size_t mem) { -#ifndef ROCKSDB_LITE assert(cache_res_mgr_ != nullptr); // Use a mutex to protect various data structures. Can be optimized to a // lock-free solution if it ends up with a performance bottleneck. @@ -86,9 +81,6 @@ void WriteBufferManager::ReserveMemWithCache(size_t mem) { // [TODO] We'll need to improve it in the future and figure out what to do on // error s.PermitUncheckedError(); -#else - (void)mem; -#endif // ROCKSDB_LITE } void WriteBufferManager::ScheduleFreeMem(size_t mem) { @@ -108,7 +100,6 @@ void WriteBufferManager::FreeMem(size_t mem) { } void WriteBufferManager::FreeMemWithCache(size_t mem) { -#ifndef ROCKSDB_LITE assert(cache_res_mgr_ != nullptr); // Use a mutex to protect various data structures. Can be optimized to a // lock-free solution if it ends up with a performance bottleneck. @@ -122,9 +113,6 @@ void WriteBufferManager::FreeMemWithCache(size_t mem) { // [TODO] We'll need to improve it in the future and figure out what to do on // error s.PermitUncheckedError(); -#else - (void)mem; -#endif // ROCKSDB_LITE } void WriteBufferManager::BeginWriteStall(StallInterface* wbm_stall) { diff --git a/memtable/write_buffer_manager_test.cc b/memtable/write_buffer_manager_test.cc index 1cc4c2cc576..398c079306c 100644 --- a/memtable/write_buffer_manager_test.cc +++ b/memtable/write_buffer_manager_test.cc @@ -14,7 +14,6 @@ namespace ROCKSDB_NAMESPACE { class WriteBufferManagerTest : public testing::Test {}; -#ifndef ROCKSDB_LITE const size_t kSizeDummyEntry = 256 * 1024; TEST_F(WriteBufferManagerTest, ShouldFlush) { @@ -295,7 +294,6 @@ TEST_F(ChargeWriteBufferTest, BasicWithCacheFull) { 46 * kSizeDummyEntry + kMetaDataChargeOverhead); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/monitoring/statistics.cc b/monitoring/statistics.cc index 2c83fe05f66..4864a07ac5b 100644 --- a/monitoring/statistics.cc +++ b/monitoring/statistics.cc @@ -275,7 +275,6 @@ std::shared_ptr CreateDBStatistics() { return std::make_shared(nullptr); } -#ifndef ROCKSDB_LITE static int RegisterBuiltinStatistics(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -287,17 +286,14 @@ static int RegisterBuiltinStatistics(ObjectLibrary& library, }); return 1; } -#endif // ROCKSDB_LITE Status Statistics::CreateFromString(const ConfigOptions& config_options, const std::string& id, std::shared_ptr* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinStatistics(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE Status s; if (id == "" || id == StatisticsImpl::kClassName()) { result->reset(new StatisticsImpl(nullptr)); @@ -310,11 +306,9 @@ Status Statistics::CreateFromString(const ConfigOptions& config_options, } static std::unordered_map stats_type_info = { -#ifndef ROCKSDB_LITE {"inner", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByNameAllowFromNull, OptionTypeFlags::kCompareNever)}, -#endif // !ROCKSDB_LITE }; StatisticsImpl::StatisticsImpl(std::shared_ptr stats) diff --git a/monitoring/statistics_test.cc b/monitoring/statistics_test.cc index cffa5054a97..98aae0c8262 100644 --- a/monitoring/statistics_test.cc +++ b/monitoring/statistics_test.cc @@ -42,12 +42,10 @@ TEST_F(StatisticsTest, SanityHistograms) { TEST_F(StatisticsTest, NoNameStats) { static std::unordered_map no_name_opt_info = { -#ifndef ROCKSDB_LITE {"inner", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByName, OptionTypeFlags::kAllowNull | OptionTypeFlags::kCompareNever)}, -#endif // ROCKSDB_LITE }; class DefaultNameStatistics : public Statistics { @@ -73,7 +71,6 @@ TEST_F(StatisticsTest, NoNameStats) { options.ignore_unsupported_options = false; auto stats = std::make_shared(); ASSERT_STREQ(stats->Name(), ""); -#ifndef ROCKSDB_LITE ASSERT_EQ("", stats->ToString( options)); // A stats with no name with have no options... ASSERT_OK(stats->ConfigureFromString(options, "inner=")); @@ -81,7 +78,6 @@ TEST_F(StatisticsTest, NoNameStats) { options)); // A stats with no name with have no options... ASSERT_NE(stats->inner, nullptr); ASSERT_NE("", stats->inner->ToString(options)); // ... even if it does... -#endif // ROCKSDB_LITE } } // namespace ROCKSDB_NAMESPACE diff --git a/monitoring/stats_history_test.cc b/monitoring/stats_history_test.cc index fed8535f4fb..cfed7bad76e 100644 --- a/monitoring/stats_history_test.cc +++ b/monitoring/stats_history_test.cc @@ -29,7 +29,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE class StatsHistoryTest : public DBTestBase { public: StatsHistoryTest() : DBTestBase("stats_history_test", /*env_do_fsync=*/true) { @@ -654,7 +653,6 @@ TEST_F(StatsHistoryTest, ForceManualFlushStatsCF) { Close(); } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/options/cf_options.cc b/options/cf_options.cc index dbf0bf9b0c8..46016f1fc7d 100644 --- a/options/cf_options.cc +++ b/options/cf_options.cc @@ -36,7 +36,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE static Status ParseCompressionOptions(const std::string& value, const std::string& name, CompressionOptions& compression_opts) { @@ -879,7 +878,6 @@ std::unique_ptr CFOptionsAsConfigurable( std::unique_ptr ptr(new ConfigurableCFOptions(opts, opt_map)); return ptr; } -#endif // ROCKSDB_LITE ImmutableCFOptions::ImmutableCFOptions() : ImmutableCFOptions(Options()) {} @@ -1138,7 +1136,6 @@ void MutableCFOptions::Dump(Logger* log) const { MutableCFOptions::MutableCFOptions(const Options& options) : MutableCFOptions(ColumnFamilyOptions(options)) {} -#ifndef ROCKSDB_LITE Status GetMutableOptionsFromStrings( const MutableCFOptions& base_options, const std::unordered_map& options_map, @@ -1162,5 +1159,4 @@ Status GetStringFromMutableCFOptions(const ConfigOptions& config_options, return OptionTypeInfo::SerializeType( config_options, cf_mutable_options_type_info, &mutable_opts, opt_string); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/cf_options.h b/options/cf_options.h index 050618eda3b..e038fee3dc7 100644 --- a/options/cf_options.h +++ b/options/cf_options.h @@ -330,7 +330,6 @@ uint64_t MaxFileSizeForLevel(const MutableCFOptions& cf_options, // `pin_l0_filter_and_index_blocks_in_cache` is set. size_t MaxFileSizeForL0MetaPin(const MutableCFOptions& cf_options); -#ifndef ROCKSDB_LITE Status GetStringFromMutableCFOptions(const ConfigOptions& config_options, const MutableCFOptions& mutable_opts, std::string* opt_string); @@ -339,6 +338,5 @@ Status GetMutableOptionsFromStrings( const MutableCFOptions& base_options, const std::unordered_map& options_map, Logger* info_log, MutableCFOptions* new_options); -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/configurable.cc b/options/configurable.cc index 08aff10fd2c..5491336e0a7 100644 --- a/options/configurable.cc +++ b/options/configurable.cc @@ -22,11 +22,7 @@ void Configurable::RegisterOptions( const std::unordered_map* type_map) { RegisteredOptions opts; opts.name = name; -#ifndef ROCKSDB_LITE opts.type_map = type_map; -#else - (void)type_map; -#endif // ROCKSDB_LITE opts.opt_ptr = opt_ptr; options_.emplace_back(opts); } @@ -41,7 +37,6 @@ Status Configurable::PrepareOptions(const ConfigOptions& opts) { // We ignore the invoke_prepare_options here intentionally, // as if you are here, you must have called PrepareOptions explicitly. Status status = Status::OK(); -#ifndef ROCKSDB_LITE for (auto opt_iter : options_) { if (opt_iter.type_map != nullptr) { for (auto map_iter : *(opt_iter.type_map)) { @@ -55,16 +50,12 @@ Status Configurable::PrepareOptions(const ConfigOptions& opts) { } } } -#else - (void)opts; -#endif // ROCKSDB_LITE return status; } Status Configurable::ValidateOptions(const DBOptions& db_opts, const ColumnFamilyOptions& cf_opts) const { Status status; -#ifndef ROCKSDB_LITE for (auto opt_iter : options_) { if (opt_iter.type_map != nullptr) { for (auto map_iter : *(opt_iter.type_map)) { @@ -79,10 +70,6 @@ Status Configurable::ValidateOptions(const DBOptions& db_opts, } } } -#else - (void)db_opts; - (void)cf_opts; -#endif // ROCKSDB_LITE return status; } @@ -105,7 +92,6 @@ std::string Configurable::GetOptionName(const std::string& opt_name) const { return opt_name; } -#ifndef ROCKSDB_LITE const OptionTypeInfo* ConfigurableHelper::FindOption( const std::vector& options, const std::string& short_name, std::string* opt_name, void** opt_ptr) { @@ -121,7 +107,6 @@ const OptionTypeInfo* ConfigurableHelper::FindOption( } return nullptr; } -#endif // ROCKSDB_LITE //************************************************************************* // @@ -156,7 +141,6 @@ Status Configurable::ConfigureOptions( // the configuration is complete. ConfigOptions copy = config_options; copy.invoke_prepare_options = false; -#ifndef ROCKSDB_LITE if (!config_options.ignore_unknown_options) { // If we are not ignoring unused, get the defaults in case we need to // reset @@ -164,14 +148,12 @@ Status Configurable::ConfigureOptions( copy.delimiter = "; "; GetOptionString(copy, &curr_opts).PermitUncheckedError(); } -#endif // ROCKSDB_LITE s = ConfigurableHelper::ConfigureOptions(copy, *this, opts_map, unused); } if (config_options.invoke_prepare_options && s.ok()) { s = PrepareOptions(config_options); } -#ifndef ROCKSDB_LITE if (!s.ok() && !curr_opts.empty()) { ConfigOptions reset = config_options; reset.ignore_unknown_options = true; @@ -180,7 +162,6 @@ Status Configurable::ConfigureOptions( // There are some options to reset from this current error ConfigureFromString(reset, curr_opts).PermitUncheckedError(); } -#endif // ROCKSDB_LITE return s; } @@ -193,7 +174,6 @@ Status Configurable::ConfigureFromString(const ConfigOptions& config_options, const std::string& opts_str) { Status s; if (!opts_str.empty()) { -#ifndef ROCKSDB_LITE if (opts_str.find(';') != std::string::npos || opts_str.find('=') != std::string::npos) { std::unordered_map opt_map; @@ -202,14 +182,11 @@ Status Configurable::ConfigureFromString(const ConfigOptions& config_options, s = ConfigureFromMap(config_options, opt_map, nullptr); } } else { -#endif // ROCKSDB_LITE s = ParseStringOptions(config_options, opts_str); if (s.ok() && config_options.invoke_prepare_options) { s = PrepareOptions(config_options); } -#ifndef ROCKSDB_LITE } -#endif // ROCKSDB_LITE } else if (config_options.invoke_prepare_options) { s = PrepareOptions(config_options); } else { @@ -218,7 +195,6 @@ Status Configurable::ConfigureFromString(const ConfigOptions& config_options, return s; } -#ifndef ROCKSDB_LITE /** * Sets the value of the named property to the input value, returning OK on * succcess. @@ -257,7 +233,6 @@ Status Configurable::ParseOption(const ConfigOptions& config_options, } } -#endif // ROCKSDB_LITE Status ConfigurableHelper::ConfigureOptions( const ConfigOptions& config_options, Configurable& configurable, @@ -266,7 +241,6 @@ Status ConfigurableHelper::ConfigureOptions( std::unordered_map remaining = opts_map; Status s = Status::OK(); if (!opts_map.empty()) { -#ifndef ROCKSDB_LITE for (const auto& iter : configurable.options_) { if (iter.type_map != nullptr) { s = ConfigureSomeOptions(config_options, configurable, *(iter.type_map), @@ -278,12 +252,6 @@ Status ConfigurableHelper::ConfigureOptions( } } } -#else - (void)configurable; - if (!config_options.ignore_unknown_options) { - s = Status::NotSupported("ConfigureFromMap not supported in LITE mode"); - } -#endif // ROCKSDB_LITE } if (unused != nullptr && !remaining.empty()) { unused->insert(remaining.begin(), remaining.end()); @@ -296,7 +264,6 @@ Status ConfigurableHelper::ConfigureOptions( return s; } -#ifndef ROCKSDB_LITE /** * Updates the object with the named-value property values, returning OK on * succcess. Any properties that were found are removed from the options list; @@ -480,7 +447,6 @@ Status ConfigurableHelper::ConfigureOption( return Status::NotFound("Could not find option: ", name); } } -#endif // ROCKSDB_LITE //******************************************************************************* // @@ -492,16 +458,10 @@ Status Configurable::GetOptionString(const ConfigOptions& config_options, std::string* result) const { assert(result); result->clear(); -#ifndef ROCKSDB_LITE return ConfigurableHelper::SerializeOptions(config_options, *this, "", result); -#else - (void)config_options; - return Status::NotSupported("GetOptionString not supported in LITE mode"); -#endif // ROCKSDB_LITE } -#ifndef ROCKSDB_LITE std::string Configurable::ToString(const ConfigOptions& config_options, const std::string& prefix) const { std::string result = SerializeOptions(config_options, prefix); @@ -601,14 +561,12 @@ Status ConfigurableHelper::SerializeOptions(const ConfigOptions& config_options, } return Status::OK(); } -#endif // ROCKSDB_LITE //******************************************************************************** // // Methods for listing the options from Configurables // //******************************************************************************** -#ifndef ROCKSDB_LITE Status Configurable::GetOptionNames( const ConfigOptions& config_options, std::unordered_set* result) const { @@ -639,7 +597,6 @@ Status ConfigurableHelper::ListOptions( } return status; } -#endif // ROCKSDB_LITE //******************************************************************************* // @@ -655,18 +612,13 @@ bool Configurable::AreEquivalent(const ConfigOptions& config_options, if (this == other || config_options.IsCheckDisabled()) { return true; } else if (other != nullptr) { -#ifndef ROCKSDB_LITE return ConfigurableHelper::AreEquivalent(config_options, *this, *other, name); -#else - return true; -#endif // ROCKSDB_LITE } else { return false; } } -#ifndef ROCKSDB_LITE bool Configurable::OptionsAreEqual(const ConfigOptions& config_options, const OptionTypeInfo& opt_info, const std::string& opt_name, @@ -722,7 +674,6 @@ bool ConfigurableHelper::AreEquivalent(const ConfigOptions& config_options, } return true; } -#endif // ROCKSDB_LITE Status Configurable::GetOptionsMap( const std::string& value, const std::string& default_id, std::string* id, @@ -734,7 +685,6 @@ Status Configurable::GetOptionsMap( *id = default_id; } else if (value.find('=') == std::string::npos) { *id = value; -#ifndef ROCKSDB_LITE } else { status = StringToMap(value, props); if (!status.ok()) { // There was an error creating the map. @@ -756,11 +706,6 @@ Status Configurable::GetOptionsMap( props->clear(); // Clear the properties } } -#else - } else { - *id = value; - props->clear(); -#endif } return status; } diff --git a/options/configurable_helper.h b/options/configurable_helper.h index 0f5f918cb60..5d409f82a45 100644 --- a/options/configurable_helper.h +++ b/options/configurable_helper.h @@ -46,7 +46,6 @@ class ConfigurableHelper { const std::unordered_map& options, std::unordered_map* unused); -#ifndef ROCKSDB_LITE // Internal method to configure a set of options for this object. // Classes may override this value to change its behavior. // @param config_options Controls how the options are being configured @@ -181,7 +180,6 @@ class ConfigurableHelper { const ConfigOptions& config_options, Configurable& configurable, const OptionTypeInfo& opt_info, const std::string& opt_name, const std::string& name, const std::string& value, void* opt_ptr); -#endif // ROCKSDB_LITE }; } // namespace ROCKSDB_NAMESPACE diff --git a/options/configurable_test.cc b/options/configurable_test.cc index 6ec02cf3a48..a03d8f0a52f 100644 --- a/options/configurable_test.cc +++ b/options/configurable_test.cc @@ -46,20 +46,16 @@ class StringLogger : public Logger { std::string string_; }; static std::unordered_map struct_option_info = { -#ifndef ROCKSDB_LITE {"struct", OptionTypeInfo::Struct("struct", &simple_option_info, 0, OptionVerificationType::kNormal, OptionTypeFlags::kMutable)}, -#endif // ROCKSDB_LITE }; static std::unordered_map imm_struct_option_info = { -#ifndef ROCKSDB_LITE {"struct", OptionTypeInfo::Struct("struct", &simple_option_info, 0, OptionVerificationType::kNormal, OptionTypeFlags::kNone)}, -#endif // ROCKSDB_LITE }; class SimpleConfigurable : public TestConfigurable { @@ -113,14 +109,12 @@ TEST_F(ConfigurableTest, ConfigureFromMapTest) { auto* opts = configurable->GetOptions("simple"); ASSERT_OK(configurable->ConfigureFromMap(config_options_, {})); ASSERT_NE(opts, nullptr); -#ifndef ROCKSDB_LITE std::unordered_map options_map = { {"int", "1"}, {"bool", "true"}, {"string", "string"}}; ASSERT_OK(configurable->ConfigureFromMap(config_options_, options_map)); ASSERT_EQ(opts->i, 1); ASSERT_EQ(opts->b, true); ASSERT_EQ(opts->s, "string"); -#endif } TEST_F(ConfigurableTest, ConfigureFromStringTest) { @@ -128,16 +122,13 @@ TEST_F(ConfigurableTest, ConfigureFromStringTest) { auto* opts = configurable->GetOptions("simple"); ASSERT_OK(configurable->ConfigureFromString(config_options_, "")); ASSERT_NE(opts, nullptr); -#ifndef ROCKSDB_LITE // GetOptionsFromMap is not supported in ROCKSDB_LITE ASSERT_OK(configurable->ConfigureFromString(config_options_, "int=1;bool=true;string=s")); ASSERT_EQ(opts->i, 1); ASSERT_EQ(opts->b, true); ASSERT_EQ(opts->s, "s"); -#endif } -#ifndef ROCKSDB_LITE // GetOptionsFromMap is not supported in ROCKSDB_LITE TEST_F(ConfigurableTest, ConfigureIgnoreTest) { std::unique_ptr configurable(SimpleConfigurable::Create()); std::unordered_map options_map = {{"unused", "u"}}; @@ -217,27 +208,21 @@ TEST_F(ConfigurableTest, InvalidOptionTest) { } static std::unordered_map validated_option_info = { -#ifndef ROCKSDB_LITE {"validated", {0, OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; static std::unordered_map prepared_option_info = { -#ifndef ROCKSDB_LITE {"prepared", {0, OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kMutable}}, -#endif // ROCKSDB_LITE }; static std::unordered_map dont_prepare_option_info = { -#ifndef ROCKSDB_LITE {"unique", {0, OptionType::kConfigurable, OptionVerificationType::kNormal, (OptionTypeFlags::kUnique | OptionTypeFlags::kDontPrepare)}}, -#endif // ROCKSDB_LITE }; class ValidatedConfigurable : public SimpleConfigurable { @@ -367,11 +352,9 @@ TEST_F(ConfigurableTest, CopyObjectTest) { TEST_F(ConfigurableTest, MutableOptionsTest) { static std::unordered_map imm_option_info = { -#ifndef ROCKSDB_LITE {"imm", OptionTypeInfo::Struct("imm", &simple_option_info, 0, OptionVerificationType::kNormal, OptionTypeFlags::kNone)}, -#endif // ROCKSDB_LITE }; class MutableConfigurable : public SimpleConfigurable { @@ -610,7 +593,6 @@ TEST_F(ConfigurableTest, ConfigurableEnumTest) { ASSERT_NOK(base->ConfigureOption(config_options_, "unknown", "bad")); } -#ifndef ROCKSDB_LITE static std::unordered_map noserialize_option_info = { {"int", @@ -680,7 +662,6 @@ TEST_F(ConfigurableTest, NullOptionMapTest) { ASSERT_OK(copy->ConfigureFromString(config_options_, str)); ASSERT_TRUE(base->AreEquivalent(config_options_, copy.get(), &str)); } -#endif static std::unordered_map TestFactories = { {"Simple", []() { return SimpleConfigurable::Create("simple"); }}, @@ -867,7 +848,6 @@ INSTANTIATE_TEST_CASE_P( std::pair("BlockBased", "block_size=1024;" "no_block_cache=true;"))); -#endif // ROCKSDB_LITE } // namespace test } // namespace ROCKSDB_NAMESPACE diff --git a/options/configurable_test.h b/options/configurable_test.h index cf9d0667837..3d6fe84108b 100644 --- a/options/configurable_test.h +++ b/options/configurable_test.h @@ -38,7 +38,6 @@ struct TestOptions { }; static std::unordered_map simple_option_info = { -#ifndef ROCKSDB_LITE {"int", {offsetof(struct TestOptions, i), OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kMutable}}, @@ -48,37 +47,28 @@ static std::unordered_map simple_option_info = { {"string", {offsetof(struct TestOptions, s), OptionType::kString, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; static std::unordered_map enum_option_info = { -#ifndef ROCKSDB_LITE {"enum", OptionTypeInfo::Enum(offsetof(struct TestOptions, e), &test_enum_map)} -#endif }; static std::unordered_map unique_option_info = { -#ifndef ROCKSDB_LITE {"unique", {0, OptionType::kConfigurable, OptionVerificationType::kNormal, (OptionTypeFlags::kUnique | OptionTypeFlags::kMutable)}}, -#endif // ROCKSDB_LITE }; static std::unordered_map shared_option_info = { -#ifndef ROCKSDB_LITE {"shared", {0, OptionType::kConfigurable, OptionVerificationType::kNormal, (OptionTypeFlags::kShared)}}, -#endif // ROCKSDB_LITE }; static std::unordered_map pointer_option_info = { -#ifndef ROCKSDB_LITE {"pointer", {0, OptionType::kConfigurable, OptionVerificationType::kNormal, OptionTypeFlags::kRawPointer}}, -#endif // ROCKSDB_LITE }; enum TestConfigMode { diff --git a/options/customizable.cc b/options/customizable.cc index cd39550e524..2f154d84c57 100644 --- a/options/customizable.cc +++ b/options/customizable.cc @@ -35,7 +35,6 @@ std::string Customizable::GenerateIndividualId() const { return ostr.str(); } -#ifndef ROCKSDB_LITE Status Customizable::GetOption(const ConfigOptions& config_options, const std::string& opt_name, std::string* value) const { @@ -68,7 +67,6 @@ std::string Customizable::SerializeOptions(const ConfigOptions& config_options, return result; } -#endif // ROCKSDB_LITE bool Customizable::AreEquivalent(const ConfigOptions& config_options, const Configurable* other, @@ -102,9 +100,6 @@ Status Customizable::GetOptionsMap( } else if (customizable != nullptr) { status = Configurable::GetOptionsMap(value, customizable->GetId(), id, props); -#ifdef ROCKSDB_LITE - (void)config_options; -#else if (status.ok() && customizable->IsInstanceOf(*id)) { // The new ID and the old ID match, so the objects are the same type. // Try to get the existing options, ignoring any errors @@ -118,7 +113,6 @@ Status Customizable::GetOptionsMap( } } } -#endif // ROCKSDB_LITE } else { status = Configurable::GetOptionsMap(value, "", id, props); } diff --git a/options/customizable_test.cc b/options/customizable_test.cc index 2ed4eeb9e7e..4de5bfaefe2 100644 --- a/options/customizable_test.cc +++ b/options/customizable_test.cc @@ -84,7 +84,6 @@ class TestCustomizable : public Customizable { const char* Name() const override { return name_.c_str(); } static const char* Type() { return "test.custom"; } -#ifndef ROCKSDB_LITE static Status CreateFromString(const ConfigOptions& opts, const std::string& value, std::unique_ptr* result); @@ -94,7 +93,6 @@ class TestCustomizable : public Customizable { static Status CreateFromString(const ConfigOptions& opts, const std::string& value, TestCustomizable** result); -#endif // ROCKSDB_LITE bool IsInstanceOf(const std::string& name) const override { if (name == kClassName()) { return true; @@ -114,14 +112,12 @@ struct AOptions { }; static std::unordered_map a_option_info = { -#ifndef ROCKSDB_LITE {"int", {offsetof(struct AOptions, i), OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kMutable}}, {"bool", {offsetof(struct AOptions, b), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; class ACustomizable : public TestCustomizable { @@ -144,14 +140,12 @@ struct BOptions { }; static std::unordered_map b_option_info = { -#ifndef ROCKSDB_LITE {"string", {offsetof(struct BOptions, s), OptionType::kString, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"bool", {offsetof(struct BOptions, b), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; class BCustomizable : public TestCustomizable { @@ -166,7 +160,6 @@ class BCustomizable : public TestCustomizable { BOptions opts_; }; -#ifndef ROCKSDB_LITE static bool LoadSharedB(const std::string& id, std::shared_ptr* result) { if (id == "B") { @@ -199,7 +192,6 @@ static int RegisterCustomTestObjects(ObjectLibrary& library, size_t num_types; return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE struct SimpleOptions { static const char* kName() { return "simple"; } @@ -210,7 +202,6 @@ struct SimpleOptions { }; static std::unordered_map simple_option_info = { -#ifndef ROCKSDB_LITE {"bool", {offsetof(struct SimpleOptions, b), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, @@ -226,7 +217,6 @@ static std::unordered_map simple_option_info = { OptionTypeInfo::AsCustomRawPtr( offsetof(struct SimpleOptions, cp), OptionVerificationType::kNormal, OptionTypeFlags::kAllowNull)}, -#endif // ROCKSDB_LITE }; class SimpleConfigurable : public Configurable { @@ -242,7 +232,6 @@ class SimpleConfigurable : public Configurable { } }; -#ifndef ROCKSDB_LITE static void GetMapFromProperties( const std::string& props, std::unordered_map* map) { @@ -258,10 +247,8 @@ static void GetMapFromProperties( (*map)[name] = value; } } -#endif // ROCKSDB_LITE } // namespace -#ifndef ROCKSDB_LITE Status TestCustomizable::CreateFromString( const ConfigOptions& config_options, const std::string& value, std::shared_ptr* result) { @@ -306,23 +293,18 @@ Status TestCustomizable::CreateFromString(const ConfigOptions& config_options, }, result); } -#endif // ROCKSDB_LITE class CustomizableTest : public testing::Test { public: CustomizableTest() { config_options_.invoke_prepare_options = false; -#ifndef ROCKSDB_LITE - // GetOptionsFromMap is not supported in ROCKSDB_LITE config_options_.registry->AddLibrary("CustomizableTest", RegisterCustomTestObjects, ""); -#endif // ROCKSDB_LITE } ConfigOptions config_options_; }; -#ifndef ROCKSDB_LITE // GetOptionsFromMap is not supported in ROCKSDB_LITE // Tests that a Customizable can be created by: // - a simple name // - a XXX.id option @@ -584,11 +566,9 @@ TEST_F(CustomizableTest, IsInstanceOfTest) { TEST_F(CustomizableTest, PrepareOptionsTest) { static std::unordered_map p_option_info = { -#ifndef ROCKSDB_LITE {"can_prepare", {0, OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; class PrepareCustomizable : public TestCustomizable { @@ -665,11 +645,9 @@ TEST_F(CustomizableTest, PrepareOptionsTest) { namespace { static std::unordered_map inner_option_info = { -#ifndef ROCKSDB_LITE {"inner", OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kNormal, OptionTypeFlags::kStringNameOnly)} -#endif // ROCKSDB_LITE }; struct InnerOptions { @@ -947,7 +925,6 @@ TEST_F(CustomizableTest, NewEmptyStaticTest) { } namespace { -#ifndef ROCKSDB_LITE static std::unordered_map vector_option_info = { {"vector", OptionTypeInfo::Vector>( @@ -996,7 +973,6 @@ TEST_F(CustomizableTest, NoNameTest) { ASSERT_EQ(copts->cu, nullptr); } -#endif // ROCKSDB_LITE TEST_F(CustomizableTest, IgnoreUnknownObjects) { ConfigOptions ignore = config_options_; @@ -1317,7 +1293,6 @@ TEST_F(CustomizableTest, CreateManagedObjects) { ASSERT_EQ(mc1, obj); } -#endif // !ROCKSDB_LITE namespace { class TestSecondaryCache : public SecondaryCache { @@ -1385,7 +1360,6 @@ class MockMemoryAllocator : public BaseMemoryAllocator { const char* Name() const override { return kClassName(); } }; -#ifndef ROCKSDB_LITE class MockEncryptionProvider : public EncryptionProvider { public: explicit MockEncryptionProvider(const std::string& id) : id_(id) {} @@ -1428,7 +1402,6 @@ class MockCipher : public BlockCipher { Status Encrypt(char* /*data*/) override { return Status::NotSupported(); } Status Decrypt(char* data) override { return Encrypt(data); } }; -#endif // ROCKSDB_LITE class DummyFileSystem : public FileSystemWrapper { public: @@ -1438,9 +1411,7 @@ class DummyFileSystem : public FileSystemWrapper { const char* Name() const override { return kClassName(); } }; -#ifndef ROCKSDB_LITE -#endif // ROCKSDB_LITE class MockTablePropertiesCollectorFactory : public TablePropertiesCollectorFactory { @@ -1489,7 +1460,6 @@ class MockFilterPolicy : public FilterPolicy { } }; -#ifndef ROCKSDB_LITE static int RegisterLocalObjects(ObjectLibrary& library, const std::string& /*arg*/) { size_t num_types; @@ -1615,7 +1585,6 @@ static int RegisterLocalObjects(ObjectLibrary& library, return static_cast(library.GetFactoryCount(&num_types)); } -#endif // !ROCKSDB_LITE } // namespace class LoadCustomizableTest : public testing::Test { @@ -1625,16 +1594,11 @@ class LoadCustomizableTest : public testing::Test { config_options_.invoke_prepare_options = false; } bool RegisterTests(const std::string& arg) { -#ifndef ROCKSDB_LITE config_options_.registry->AddLibrary("custom-tests", test::RegisterTestObjects, arg); config_options_.registry->AddLibrary("local-tests", RegisterLocalObjects, arg); return true; -#else - (void)arg; - return false; -#endif // !ROCKSDB_LITE } template @@ -1676,11 +1640,9 @@ class LoadCustomizableTest : public testing::Test { std::unordered_set factories = expected; Status s = T::CreateFromString(config_options_, mock, object); EXPECT_NOK(s); -#ifndef ROCKSDB_LITE std::vector builtins; ObjectLibrary::Default()->GetFactoryNames(T::Type(), &builtins); factories.insert(builtins.begin(), builtins.end()); -#endif // ROCKSDB_LITE Status result; int created = 0; for (const auto& name : factories) { @@ -1702,7 +1664,6 @@ class LoadCustomizableTest : public testing::Test { EXPECT_TRUE(object->get()->IsInstanceOf(name)); } } -#ifndef ROCKSDB_LITE std::vector plugins; ObjectRegistry::Default()->GetFactoryNames(T::Type(), &plugins); if (plugins.size() > builtins.size()) { @@ -1737,10 +1698,6 @@ class LoadCustomizableTest : public testing::Test { T::Type(), created, (int)expected.size(), (int)(factories.size() - expected.size()), (int)(plugins.size() - builtins.size()), (int)failed->size()); -#else - printf("%s: Created %d (expected %d) %d Failed\n", T::Type(), created, - (int)expected.size(), (int)failed->size()); -#endif // ROCKSDB_LITE return result; } @@ -1771,11 +1728,9 @@ class LoadCustomizableTest : public testing::Test { std::unordered_set factories = expected; Status s = TestCreateStatic(mock, object, delete_objects); EXPECT_NOK(s); -#ifndef ROCKSDB_LITE std::vector builtins; ObjectLibrary::Default()->GetFactoryNames(T::Type(), &builtins); factories.insert(builtins.begin(), builtins.end()); -#endif // ROCKSDB_LITE int created = 0; Status result; for (const auto& name : factories) { @@ -1786,7 +1741,6 @@ class LoadCustomizableTest : public testing::Test { failed->push_back(name); } } -#ifndef ROCKSDB_LITE std::vector plugins; ObjectRegistry::Default()->GetFactoryNames(T::Type(), &plugins); if (plugins.size() > builtins.size()) { @@ -1814,10 +1768,6 @@ class LoadCustomizableTest : public testing::Test { T::Type(), created, (int)expected.size(), (int)(factories.size() - expected.size()), (int)(plugins.size() - builtins.size()), (int)failed->size()); -#else - printf("%s: Created %d (expected %d) %d Failed\n", T::Type(), created, - (int)expected.size(), (int)failed->size()); -#endif // ROCKSDB_LITE return result; } @@ -1831,7 +1781,6 @@ TEST_F(LoadCustomizableTest, LoadTableFactoryTest) { ASSERT_OK( TestSharedBuiltins(mock::MockTableFactory::kClassName(), TableFactory::kBlockBasedTableName())); -#ifndef ROCKSDB_LITE std::string opts_str = "table_factory="; ASSERT_OK(GetColumnFamilyOptionsFromString( config_options_, cf_opts_, @@ -1839,17 +1788,14 @@ TEST_F(LoadCustomizableTest, LoadTableFactoryTest) { ASSERT_NE(cf_opts_.table_factory.get(), nullptr); ASSERT_STREQ(cf_opts_.table_factory->Name(), TableFactory::kBlockBasedTableName()); -#endif // ROCKSDB_LITE if (RegisterTests("Test")) { ExpectCreateShared(mock::MockTableFactory::kClassName()); -#ifndef ROCKSDB_LITE ASSERT_OK(GetColumnFamilyOptionsFromString( config_options_, cf_opts_, opts_str + mock::MockTableFactory::kClassName(), &cf_opts_)); ASSERT_NE(cf_opts_.table_factory.get(), nullptr); ASSERT_STREQ(cf_opts_.table_factory->Name(), mock::MockTableFactory::kClassName()); -#endif // ROCKSDB_LITE } } @@ -1870,7 +1816,6 @@ TEST_F(LoadCustomizableTest, LoadSecondaryCacheTest) { } } -#ifndef ROCKSDB_LITE TEST_F(LoadCustomizableTest, LoadSstPartitionerFactoryTest) { ASSERT_OK(TestSharedBuiltins( "Mock", SstPartitionerFixedPrefixFactory::kClassName())); @@ -1878,7 +1823,6 @@ TEST_F(LoadCustomizableTest, LoadSstPartitionerFactoryTest) { ExpectCreateShared("Mock"); } } -#endif // ROCKSDB_LITE TEST_F(LoadCustomizableTest, LoadChecksumGenFactoryTest) { ASSERT_OK(TestSharedBuiltins("Mock", "")); @@ -1945,7 +1889,6 @@ TEST_F(LoadCustomizableTest, LoadStatisticsTest) { ASSERT_NE(db_opts_.statistics, nullptr); ASSERT_STREQ(db_opts_.statistics->Name(), "BasicStatistics"); -#ifndef ROCKSDB_LITE ASSERT_NOK(GetDBOptionsFromString(config_options_, db_opts_, "statistics=Test", &db_opts_)); ASSERT_OK(GetDBOptionsFromString(config_options_, db_opts_, @@ -1981,7 +1924,6 @@ TEST_F(LoadCustomizableTest, LoadStatisticsTest) { ASSERT_NE(inner->get(), nullptr); ASSERT_STREQ(inner->get()->Name(), TestStatistics::kClassName()); } -#endif } TEST_F(LoadCustomizableTest, LoadMemTableRepFactoryTest) { @@ -2011,7 +1953,6 @@ TEST_F(LoadCustomizableTest, LoadMergeOperatorTest) { "put", "put_v1", "PutOperator", "uint64add", "UInt64AddOperator", "max", "MaxOperator", }; -#ifndef ROCKSDB_LITE expected.insert({ StringAppendOperator::kClassName(), StringAppendOperator::kNickName(), @@ -2022,7 +1963,6 @@ TEST_F(LoadCustomizableTest, LoadMergeOperatorTest) { BytesXOROperator::kClassName(), BytesXOROperator::kNickName(), }); -#endif // ROCKSDB_LITE ASSERT_OK(TestExpectedBuiltins("Changling", expected, &result, &failed)); @@ -2048,7 +1988,6 @@ TEST_F(LoadCustomizableTest, LoadCompactionFilterTest) { } } -#ifndef ROCKSDB_LITE TEST_F(LoadCustomizableTest, LoadEventListenerTest) { ASSERT_OK(TestSharedBuiltins( OnFileDeletionListener::kClassName(), "")); @@ -2092,7 +2031,6 @@ TEST_F(LoadCustomizableTest, LoadEncryptionCipherTest) { ExpectCreateShared("Mock"); } } -#endif // !ROCKSDB_LITE TEST_F(LoadCustomizableTest, LoadSystemClockTest) { ASSERT_OK(TestSharedBuiltins(MockSystemClock::kClassName(), @@ -2138,20 +2076,17 @@ TEST_F(LoadCustomizableTest, LoadFilterPolicyTest) { ReadOnlyBuiltinFilterPolicy::kClassName(), }; -#ifndef ROCKSDB_LITE expected.insert({ kAutoBloom, BloomFilterPolicy::kNickName(), kAutoRibbon, RibbonFilterPolicy::kNickName(), }); -#endif // ROCKSDB_LITE ASSERT_OK(TestExpectedBuiltins( "Mock", expected, &result, &failures, [](const std::string& name) { std::vector names = {name + ":1.234"}; return names; })); -#ifndef ROCKSDB_LITE ASSERT_OK(FilterPolicy::CreateFromString( config_options_, kAutoBloom + ":1.234:false", &result)); ASSERT_NE(result.get(), nullptr); @@ -2168,7 +2103,6 @@ TEST_F(LoadCustomizableTest, LoadFilterPolicyTest) { kAutoRibbon + ":1.234:56", &result)); ASSERT_NE(result.get(), nullptr); ASSERT_TRUE(result->IsInstanceOf(kAutoRibbon)); -#endif // ROCKSDB_LITE if (RegisterTests("Test")) { ExpectCreateShared(MockFilterPolicy::kClassName(), &result); @@ -2176,7 +2110,6 @@ TEST_F(LoadCustomizableTest, LoadFilterPolicyTest) { std::shared_ptr table; -#ifndef ROCKSDB_LITE std::string table_opts = "id=BlockBasedTable; filter_policy="; ASSERT_OK(TableFactory::CreateFromString(config_options_, table_opts + "nullptr", &table)); @@ -2199,7 +2132,6 @@ TEST_F(LoadCustomizableTest, LoadFilterPolicyTest) { ASSERT_NE(bbto->filter_policy.get(), nullptr); ASSERT_TRUE( bbto->filter_policy->IsInstanceOf(MockFilterPolicy::kClassName())); -#endif // ROCKSDB_LITE } TEST_F(LoadCustomizableTest, LoadFlushBlockPolicyFactoryTest) { @@ -2220,7 +2152,6 @@ TEST_F(LoadCustomizableTest, LoadFlushBlockPolicyFactoryTest) { ASSERT_NE(result, nullptr); ASSERT_STREQ(result->Name(), FlushBlockBySizePolicyFactory::kClassName()); -#ifndef ROCKSDB_LITE std::string table_opts = "id=BlockBasedTable; flush_block_policy_factory="; ASSERT_OK(TableFactory::CreateFromString( config_options_, @@ -2242,7 +2173,6 @@ TEST_F(LoadCustomizableTest, LoadFlushBlockPolicyFactoryTest) { ASSERT_STREQ(bbto->flush_block_policy_factory->Name(), TestFlushBlockPolicyFactory::kClassName()); } -#endif // ROCKSDB_LITE } } // namespace ROCKSDB_NAMESPACE diff --git a/options/db_options.cc b/options/db_options.cc index e0bc892fc03..bb336e34c6b 100644 --- a/options/db_options.cc +++ b/options/db_options.cc @@ -25,7 +25,6 @@ #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE static std::unordered_map wal_recovery_mode_string_map = { {"kTolerateCorruptedTailRecords", @@ -670,7 +669,6 @@ std::unique_ptr DBOptionsAsConfigurable( std::unique_ptr ptr(new DBOptionsConfigurable(opts, opt_map)); return ptr; } -#endif // ROCKSDB_LITE ImmutableDBOptions::ImmutableDBOptions() : ImmutableDBOptions(Options()) {} @@ -734,9 +732,7 @@ ImmutableDBOptions::ImmutableDBOptions(const DBOptions& options) wal_recovery_mode(options.wal_recovery_mode), allow_2pc(options.allow_2pc), row_cache(options.row_cache), -#ifndef ROCKSDB_LITE wal_filter(options.wal_filter), -#endif // ROCKSDB_LITE fail_if_options_file_error(options.fail_if_options_file_error), dump_malloc_stats(options.dump_malloc_stats), avoid_flush_during_recovery(options.avoid_flush_during_recovery), @@ -888,10 +884,8 @@ void ImmutableDBOptions::Dump(Logger* log) const { ROCKS_LOG_HEADER(log, " Options.row_cache: None"); } -#ifndef ROCKSDB_LITE ROCKS_LOG_HEADER(log, " Options.wal_filter: %s", wal_filter ? wal_filter->Name() : "None"); -#endif // ROCKDB_LITE ROCKS_LOG_HEADER(log, " Options.avoid_flush_during_recovery: %d", avoid_flush_during_recovery); @@ -1051,7 +1045,6 @@ void MutableDBOptions::Dump(Logger* log) const { max_background_flushes); } -#ifndef ROCKSDB_LITE Status GetMutableDBOptionsFromStrings( const MutableDBOptions& base_options, const std::unordered_map& options_map, @@ -1082,5 +1075,4 @@ Status GetStringFromMutableDBOptions(const ConfigOptions& config_options, return OptionTypeInfo::SerializeType( config_options, db_mutable_options_type_info, &mutable_opts, opt_string); } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/db_options.h b/options/db_options.h index 8946f60ff48..2a9d98b2509 100644 --- a/options/db_options.h +++ b/options/db_options.h @@ -76,9 +76,7 @@ struct ImmutableDBOptions { WALRecoveryMode wal_recovery_mode; bool allow_2pc; std::shared_ptr row_cache; -#ifndef ROCKSDB_LITE WalFilter* wal_filter; -#endif // ROCKSDB_LITE bool fail_if_options_file_error; bool dump_malloc_stats; bool avoid_flush_during_recovery; @@ -139,7 +137,6 @@ struct MutableDBOptions { int max_background_flushes; }; -#ifndef ROCKSDB_LITE Status GetStringFromMutableDBOptions(const ConfigOptions& config_options, const MutableDBOptions& mutable_opts, std::string* opt_string); @@ -151,6 +148,5 @@ Status GetMutableDBOptionsFromStrings( bool MutableDBOptionsAreEqual(const MutableDBOptions& this_options, const MutableDBOptions& that_options); -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/options.cc b/options/options.cc index 316d3550e3e..3413caf63f5 100644 --- a/options/options.cc +++ b/options/options.cc @@ -606,7 +606,6 @@ ColumnFamilyOptions* ColumnFamilyOptions::OptimizeForSmallDb( return this; } -#ifndef ROCKSDB_LITE ColumnFamilyOptions* ColumnFamilyOptions::OptimizeForPointLookup( uint64_t block_cache_size_mb) { BlockBasedTableOptions block_based_options; @@ -678,7 +677,6 @@ DBOptions* DBOptions::IncreaseParallelism(int total_threads) { return this; } -#endif // !ROCKSDB_LITE ReadOptions::ReadOptions() : snapshot(nullptr), diff --git a/options/options_helper.cc b/options/options_helper.cc index 59b01e6fb18..dcc4cda709c 100644 --- a/options/options_helper.cc +++ b/options/options_helper.cc @@ -30,30 +30,22 @@ namespace ROCKSDB_NAMESPACE { ConfigOptions::ConfigOptions() -#ifndef ROCKSDB_LITE : registry(ObjectRegistry::NewInstance()) -#endif { env = Env::Default(); } ConfigOptions::ConfigOptions(const DBOptions& db_opts) : env(db_opts.env) { -#ifndef ROCKSDB_LITE registry = ObjectRegistry::NewInstance(); -#endif } Status ValidateOptions(const DBOptions& db_opts, const ColumnFamilyOptions& cf_opts) { Status s; -#ifndef ROCKSDB_LITE auto db_cfg = DBOptionsAsConfigurable(db_opts); auto cf_cfg = CFOptionsAsConfigurable(cf_opts); s = db_cfg->ValidateOptions(db_opts, cf_opts); if (s.ok()) s = cf_cfg->ValidateOptions(db_opts, cf_opts); -#else - s = cf_opts.table_factory->ValidateOptions(db_opts, cf_opts); -#endif return s; } @@ -154,9 +146,7 @@ DBOptions BuildDBOptions(const ImmutableDBOptions& immutable_db_options, options.wal_recovery_mode = immutable_db_options.wal_recovery_mode; options.allow_2pc = immutable_db_options.allow_2pc; options.row_cache = immutable_db_options.row_cache; -#ifndef ROCKSDB_LITE options.wal_filter = immutable_db_options.wal_filter; -#endif // ROCKSDB_LITE options.fail_if_options_file_error = immutable_db_options.fail_if_options_file_error; options.dump_malloc_stats = immutable_db_options.dump_malloc_stats; @@ -402,7 +392,6 @@ std::vector GetSupportedChecksums() { checksum_types.end()); } -#ifndef ROCKSDB_LITE static bool ParseOptionHelper(void* opt_address, const OptionType& opt_type, const std::string& value) { switch (opt_type) { @@ -1473,6 +1462,5 @@ const OptionTypeInfo* OptionTypeInfo::Find( } return nullptr; } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/options_helper.h b/options/options_helper.h index 7c751fc2526..76e312a63cf 100644 --- a/options/options_helper.h +++ b/options/options_helper.h @@ -54,7 +54,6 @@ void UpdateColumnFamilyOptions(const ImmutableCFOptions& ioptions, void UpdateColumnFamilyOptions(const MutableCFOptions& moptions, ColumnFamilyOptions* cf_opts); -#ifndef ROCKSDB_LITE std::unique_ptr DBOptionsAsConfigurable( const MutableDBOptions& opts); std::unique_ptr DBOptionsAsConfigurable( @@ -69,7 +68,6 @@ std::unique_ptr CFOptionsAsConfigurable( extern Status StringToMap( const std::string& opts_str, std::unordered_map* opts_map); -#endif // !ROCKSDB_LITE struct OptionsHelper { static const std::string kCFOptionsName /*= "ColumnFamilyOptions"*/; @@ -84,7 +82,6 @@ struct OptionsHelper { compression_type_string_map; static std::unordered_map prepopulate_blob_cache_string_map; -#ifndef ROCKSDB_LITE static std::unordered_map compaction_stop_style_string_map; static std::unordered_map encoding_type_string_map; @@ -93,7 +90,6 @@ struct OptionsHelper { static std::unordered_map compaction_pri_string_map; static std::unordered_map temperature_string_map; -#endif // !ROCKSDB_LITE }; // Some aliasing @@ -104,7 +100,6 @@ static auto& compaction_stop_style_to_string = OptionsHelper::compaction_stop_style_to_string; static auto& temperature_to_string = OptionsHelper::temperature_to_string; static auto& checksum_type_string_map = OptionsHelper::checksum_type_string_map; -#ifndef ROCKSDB_LITE static auto& compaction_stop_style_string_map = OptionsHelper::compaction_stop_style_string_map; static auto& compression_type_string_map = @@ -117,6 +112,5 @@ static auto& compaction_pri_string_map = static auto& temperature_string_map = OptionsHelper::temperature_string_map; static auto& prepopulate_blob_cache_string_map = OptionsHelper::prepopulate_blob_cache_string_map; -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/options_parser.cc b/options/options_parser.cc index 562a7b214b1..b3754de798b 100644 --- a/options/options_parser.cc +++ b/options/options_parser.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "options/options_parser.h" @@ -724,4 +723,3 @@ Status RocksDBOptionsParser::VerifyTableFactory( } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/options/options_parser.h b/options/options_parser.h index 20e3d772dab..4268051f340 100644 --- a/options/options_parser.h +++ b/options/options_parser.h @@ -14,7 +14,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE struct ConfigOptions; class OptionTypeInfo; class TableFactory; @@ -146,6 +145,5 @@ class RocksDBOptionsParser { int opt_file_version[3]; }; -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/options_settable_test.cc b/options/options_settable_test.cc index cde2af02afe..de42e247a8d 100644 --- a/options/options_settable_test.cc +++ b/options/options_settable_test.cc @@ -31,7 +31,6 @@ namespace ROCKSDB_NAMESPACE { // As a result, we only run the tests to verify new fields in options are // settable through string on limited platforms as it depends on behavior of // compilers. -#ifndef ROCKSDB_LITE #if defined OS_LINUX || defined OS_WIN #ifndef __clang__ #ifndef ROCKSDB_UBSAN_RUN @@ -604,7 +603,6 @@ TEST_F(OptionsSettableTest, ColumnFamilyOptionsAllFieldsSettable) { #endif // !ROCKSDB_UBSAN_RUN #endif // !__clang__ #endif // OS_LINUX || OS_WIN -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/options/options_test.cc b/options/options_test.cc index 46ca08092f8..4ac9a7c3f13 100644 --- a/options/options_test.cc +++ b/options/options_test.cc @@ -63,7 +63,6 @@ class UnregisteredTableFactory : public TableFactory { } }; -#ifndef ROCKSDB_LITE // GetOptionsFromMap is not supported in ROCKSDB_LITE TEST_F(OptionsTest, GetOptionsFromMapTest) { std::unordered_map cf_options_map = { {"write_buffer_size", "1"}, @@ -367,10 +366,7 @@ TEST_F(OptionsTest, GetOptionsFromMapTest) { ASSERT_NOK( RocksDBOptionsParser::VerifyDBOptions(exact, base_db_opt, new_db_opt)); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // GetColumnFamilyOptionsFromString is not supported in - // ROCKSDB_LITE TEST_F(OptionsTest, GetColumnFamilyOptionsFromStringTest) { ColumnFamilyOptions base_cf_opt; ColumnFamilyOptions new_cf_opt; @@ -896,9 +892,7 @@ TEST_F(OptionsTest, OldInterfaceTest) { RocksDBOptionsParser::VerifyDBOptions(exact, base_db_opt, new_db_opt)); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // GetBlockBasedTableOptionsFromString is not supported TEST_F(OptionsTest, GetBlockBasedTableOptionsFromString) { BlockBasedTableOptions table_opt; BlockBasedTableOptions new_opt; @@ -1139,10 +1133,8 @@ TEST_F(OptionsTest, GetBlockBasedTableOptionsFromString) { ASSERT_TRUE( new_opt.filter_policy->IsInstanceOf(RibbonFilterPolicy::kNickName())); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // GetPlainTableOptionsFromString is not supported TEST_F(OptionsTest, GetPlainTableOptionsFromString) { PlainTableOptions table_opt; PlainTableOptions new_opt; @@ -1183,9 +1175,7 @@ TEST_F(OptionsTest, GetPlainTableOptionsFromString) { ASSERT_NOK(s); ASSERT_TRUE(s.IsInvalidArgument()); } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE // GetMemTableRepFactoryFromString is not supported TEST_F(OptionsTest, GetMemTableRepFactoryFromString) { std::unique_ptr new_mem_factory = nullptr; @@ -1222,7 +1212,6 @@ TEST_F(OptionsTest, GetMemTableRepFactoryFromString) { ASSERT_NOK(GetMemTableRepFactoryFromString("bad_factory", &new_mem_factory)); } -#endif // !ROCKSDB_LITE TEST_F(OptionsTest, MemTableRepFactoryCreateFromString) { std::unique_ptr new_mem_factory = nullptr; @@ -1250,7 +1239,6 @@ TEST_F(OptionsTest, MemTableRepFactoryCreateFromString) { ASSERT_NOK(MemTableRepFactory::CreateFromString( config_options, "invalid_opt=10", &new_mem_factory)); -#ifndef ROCKSDB_LITE ASSERT_OK(MemTableRepFactory::CreateFromString( config_options, "id=skip_list; lookahead=32", &new_mem_factory)); ASSERT_OK(MemTableRepFactory::CreateFromString(config_options, "prefix_hash", @@ -1306,7 +1294,6 @@ TEST_F(OptionsTest, MemTableRepFactoryCreateFromString) { config_options, "id=vector; count=42", &new_mem_factory)); ASSERT_NOK(MemTableRepFactory::CreateFromString( config_options, "id=vector; invalid=unknown", &new_mem_factory)); -#endif // ROCKSDB_LITE ASSERT_NOK(MemTableRepFactory::CreateFromString(config_options, "cuckoo", &new_mem_factory)); // CuckooHash memtable is already removed. @@ -1317,7 +1304,6 @@ TEST_F(OptionsTest, MemTableRepFactoryCreateFromString) { &new_mem_factory)); } -#ifndef ROCKSDB_LITE // GetOptionsFromString is not supported in RocksDB Lite class CustomEnv : public EnvWrapper { public: explicit CustomEnv(Env* _target) : EnvWrapper(_target) {} @@ -1731,13 +1717,11 @@ TEST_F(OptionsTest, MutableCFOptions) { ASSERT_EQ(bbto->block_size, 32768); } -#endif // !ROCKSDB_LITE Status StringToMap( const std::string& opts_str, std::unordered_map* opts_map); -#ifndef ROCKSDB_LITE // StringToMap is not supported in ROCKSDB_LITE TEST_F(OptionsTest, StringToMapTest) { std::unordered_map opts_map; // Regular options @@ -1854,9 +1838,7 @@ TEST_F(OptionsTest, StringToMapTest) { ASSERT_NOK(StringToMap("k1=v1;k2={{}}{}", &opts_map)); ASSERT_NOK(StringToMap("k1=v1;k2={{dfdl}adfa}{}", &opts_map)); } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE // StringToMap is not supported in ROCKSDB_LITE TEST_F(OptionsTest, StringToMapRandomTest) { std::unordered_map opts_map; // Make sure segfault is not hit by semi-random strings @@ -2147,7 +2129,6 @@ TEST_F(OptionsTest, OptionTablePropertiesTest) { ASSERT_EQ(copy.table_properties_collector_factories.size(), 2); ASSERT_OK(RocksDBOptionsParser::VerifyCFOptions(cfg_opts, orig, copy)); } -#endif // !ROCKSDB_LITE TEST_F(OptionsTest, ConvertOptionsTest) { LevelDBOptions leveldb_opt; @@ -2172,7 +2153,6 @@ TEST_F(OptionsTest, ConvertOptionsTest) { leveldb_opt.block_restart_interval); ASSERT_EQ(table_opt->filter_policy.get(), leveldb_opt.filter_policy); } -#ifndef ROCKSDB_LITE class TestEventListener : public EventListener { private: std::string id_; @@ -2239,9 +2219,7 @@ TEST_F(OptionsTest, OptionsListenerTest) { 2); // The Test{Config}1 Listeners could be loaded but not the others ASSERT_OK(RocksDBOptionsParser::VerifyDBOptions(config_opts, orig, copy)); } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE const static std::string kCustomEnvName = "Custom"; const static std::string kCustomEnvProp = "env=" + kCustomEnvName; @@ -2826,7 +2804,6 @@ TEST_F(OptionsTest, SliceTransformCreateFromString) { ASSERT_NOK( SliceTransform::CreateFromString(config_options, "invalid", &transform)); -#ifndef ROCKSDB_LITE ASSERT_OK(SliceTransform::CreateFromString( config_options, "rocksdb.CappedPrefix.11", &transform)); ASSERT_NE(transform, nullptr); @@ -2850,7 +2827,6 @@ TEST_F(OptionsTest, SliceTransformCreateFromString) { ASSERT_FALSE(transform->IsInstanceOf("capped:11")); ASSERT_FALSE(transform->IsInstanceOf("rocksdb.CappedPrefix")); ASSERT_FALSE(transform->IsInstanceOf("rocksdb.CappedPrefix.11")); -#endif // ROCKSDB_LITE } TEST_F(OptionsOldApiTest, GetBlockBasedTableOptionsFromString) { @@ -3138,9 +3114,7 @@ TEST_F(OptionsOldApiTest, ColumnFamilyOptionsSerialization) { delete base_opt.compaction_filter; } } -#endif // !ROCKSDB_LITE -#ifndef ROCKSDB_LITE class OptionsParserTest : public testing::Test { public: OptionsParserTest() { fs_.reset(new test::StringFS(FileSystem::Default())); } @@ -4912,7 +4886,6 @@ TEST_F(ConfigOptionsTest, ConfiguringOptionsDoesNotRevertRateLimiterBandwidth) { INSTANTIATE_TEST_CASE_P(OptionsSanityCheckTest, OptionsSanityCheckTest, ::testing::Bool()); -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/port/stack_trace.cc b/port/stack_trace.cc index ef7144947fb..d584ea72973 100644 --- a/port/stack_trace.cc +++ b/port/stack_trace.cc @@ -5,8 +5,7 @@ // #include "port/stack_trace.h" -#if defined(ROCKSDB_LITE) || \ - !(defined(ROCKSDB_BACKTRACE) || defined(OS_MACOSX)) || defined(CYGWIN) || \ +#if !(defined(ROCKSDB_BACKTRACE) || defined(OS_MACOSX)) || defined(CYGWIN) || \ defined(OS_SOLARIS) || defined(OS_WIN) // noop diff --git a/table/adaptive/adaptive_table_factory.cc b/table/adaptive/adaptive_table_factory.cc index bbea91b5426..5a573ca992a 100644 --- a/table/adaptive/adaptive_table_factory.cc +++ b/table/adaptive/adaptive_table_factory.cc @@ -3,7 +3,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "table/adaptive/adaptive_table_factory.h" #include "port/port.h" @@ -124,4 +123,3 @@ extern TableFactory* NewAdaptiveTableFactory( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/adaptive/adaptive_table_factory.h b/table/adaptive/adaptive_table_factory.h index 3b631942d23..55c8bca1f42 100644 --- a/table/adaptive/adaptive_table_factory.h +++ b/table/adaptive/adaptive_table_factory.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -55,4 +54,3 @@ class AdaptiveTableFactory : public TableFactory { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/block_based/block_based_table_factory.cc b/table/block_based/block_based_table_factory.cc index 63520e9087c..9708db3933f 100644 --- a/table/block_based/block_based_table_factory.cc +++ b/table/block_based/block_based_table_factory.cc @@ -165,7 +165,6 @@ size_t TailPrefetchStats::GetSuggestedPrefetchSize() { return std::min(kMaxPrefetchSize, max_qualified_size); } -#ifndef ROCKSDB_LITE const std::string kOptNameMetadataCacheOpts = "metadata_cache_options"; @@ -226,11 +225,9 @@ static std::unordered_map block_based_table_type_info = { -#ifndef ROCKSDB_LITE /* currently not supported std::shared_ptr block_cache = nullptr; CacheUsageOptions cache_usage_options; @@ -414,7 +411,6 @@ static std::unordered_map OptionType::kUInt64T, OptionVerificationType::kNormal, OptionTypeFlags::kMutable}}, -#endif // ROCKSDB_LITE }; // TODO(myabandeh): We should return an error instead of silently changing the @@ -858,7 +854,6 @@ const void* BlockBasedTableFactory::GetOptionsPtr( } } -#ifndef ROCKSDB_LITE // Take a default BlockBasedTableOptions "table_options" in addition to a // map "opts_map" of option name to option value to construct the new // BlockBasedTableOptions "new_table_options". @@ -974,7 +969,6 @@ Status GetBlockBasedTableOptionsFromMap( } return s; } -#endif // !ROCKSDB_LITE TableFactory* NewBlockBasedTableFactory( const BlockBasedTableOptions& _table_options) { diff --git a/table/block_based/block_based_table_factory.h b/table/block_based/block_based_table_factory.h index 3166cd3cc90..1bf870ba6f9 100644 --- a/table/block_based/block_based_table_factory.h +++ b/table/block_based/block_based_table_factory.h @@ -80,12 +80,10 @@ class BlockBasedTableFactory : public TableFactory { protected: const void* GetOptionsPtr(const std::string& name) const override; -#ifndef ROCKSDB_LITE Status ParseOption(const ConfigOptions& config_options, const OptionTypeInfo& opt_info, const std::string& opt_name, const std::string& opt_value, void* opt_ptr) override; -#endif void InitializeOptions(); private: diff --git a/table/block_based/block_based_table_reader.cc b/table/block_based/block_based_table_reader.cc index 029a67eec62..f79636b0e47 100644 --- a/table/block_based/block_based_table_reader.cc +++ b/table/block_based/block_based_table_reader.cc @@ -732,7 +732,6 @@ Status BlockBasedTable::Open( rep->table_prefix_extractor = prefix_extractor; } else { // Current prefix_extractor doesn't match table -#ifndef ROCKSDB_LITE if (rep->table_properties) { //**TODO: If/When the DBOptions has a registry in it, the ConfigOptions // will need to use it @@ -748,7 +747,6 @@ Status BlockBasedTable::Open( st.ToString().c_str()); } } -#endif // ROCKSDB_LITE } // With properties loaded, we can set up portable/stable cache keys diff --git a/table/block_based/block_based_table_reader_test.cc b/table/block_based/block_based_table_reader_test.cc index 4a2ef7ed5fc..0981cfb615a 100644 --- a/table/block_based/block_based_table_reader_test.cc +++ b/table/block_based/block_based_table_reader_test.cc @@ -537,23 +537,12 @@ TEST_P(BlockBasedTableReaderTestVerifyChecksum, ChecksumMismatch) { // Param 2: whether to use direct reads // Param 3: Block Based Table Index type // Param 4: BBTO no_block_cache option -#ifdef ROCKSDB_LITE -// Skip direct I/O tests in lite mode since direct I/O is unsupported. -INSTANTIATE_TEST_CASE_P( - MultiGet, BlockBasedTableReaderTest, - ::testing::Combine( - ::testing::ValuesIn(GetSupportedCompressions()), - ::testing::Values(false), - ::testing::Values(BlockBasedTableOptions::IndexType::kBinarySearch), - ::testing::Values(false))); -#else // ROCKSDB_LITE INSTANTIATE_TEST_CASE_P( MultiGet, BlockBasedTableReaderTest, ::testing::Combine( ::testing::ValuesIn(GetSupportedCompressions()), ::testing::Bool(), ::testing::Values(BlockBasedTableOptions::IndexType::kBinarySearch), ::testing::Values(false))); -#endif // ROCKSDB_LITE INSTANTIATE_TEST_CASE_P( VerifyChecksum, BlockBasedTableReaderTestVerifyChecksum, ::testing::Combine( diff --git a/table/block_based/filter_policy.cc b/table/block_based/filter_policy.cc index f84f804dd6c..36f3b16d4bd 100644 --- a/table/block_based/filter_policy.cc +++ b/table/block_based/filter_policy.cc @@ -1809,7 +1809,6 @@ std::shared_ptr BloomLikeFilterPolicy::Create( } } -#ifndef ROCKSDB_LITE namespace { static ObjectLibrary::PatternEntry FilterPatternEntryWithBits( const char* name) { @@ -1918,7 +1917,6 @@ static int RegisterBuiltinFilterPolicies(ObjectLibrary& library, return static_cast(library.GetFactoryCount(&num_types)); } } // namespace -#endif // ROCKSDB_LITE Status FilterPolicy::CreateFromString( const ConfigOptions& options, const std::string& value, @@ -1940,16 +1938,11 @@ Status FilterPolicy::CreateFromString( } else if (id.empty()) { // We have no Id but have options. Not good return Status::NotSupported("Cannot reset object ", id); } else { -#ifndef ROCKSDB_LITE static std::once_flag loaded; std::call_once(loaded, [&]() { RegisterBuiltinFilterPolicies(*(ObjectLibrary::Default().get()), ""); }); status = options.registry->NewSharedObject(id, policy); -#else - status = - Status::NotSupported("Cannot load filter policy in LITE mode ", value); -#endif // ROCKSDB_LITE } if (options.ignore_unsupported_options && status.IsNotSupported()) { return Status::OK(); diff --git a/table/block_based/flush_block_policy.cc b/table/block_based/flush_block_policy.cc index 9bb1f334b34..76fe85b1ada 100644 --- a/table/block_based/flush_block_policy.cc +++ b/table/block_based/flush_block_policy.cc @@ -89,7 +89,6 @@ FlushBlockPolicy* FlushBlockBySizePolicyFactory::NewFlushBlockPolicy( return new FlushBlockBySizePolicy(size, deviation, false, data_block_builder); } -#ifndef ROCKSDB_LITE static int RegisterFlushBlockPolicyFactories(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -110,18 +109,11 @@ static int RegisterFlushBlockPolicyFactories(ObjectLibrary& library, }); return 2; } -#endif // ROCKSDB_LITE static bool LoadFlushPolicyFactory( const std::string& id, std::shared_ptr* result) { if (id.empty()) { result->reset(new FlushBlockBySizePolicyFactory()); -#ifdef ROCKSDB_LITE - } else if (id == FlushBlockBySizePolicyFactory::kClassName()) { - result->reset(new FlushBlockBySizePolicyFactory()); - } else if (id == FlushBlockEveryKeyPolicyFactory::kClassName()) { - result->reset(new FlushBlockEveryKeyPolicyFactory()); -#endif // ROCKSDB_LITE } else { return false; } @@ -134,12 +126,10 @@ FlushBlockBySizePolicyFactory::FlushBlockBySizePolicyFactory() Status FlushBlockPolicyFactory::CreateFromString( const ConfigOptions& config_options, const std::string& value, std::shared_ptr* factory) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterFlushBlockPolicyFactories(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE return LoadSharedObject( config_options, value, LoadFlushPolicyFactory, factory); } diff --git a/table/block_fetcher_test.cc b/table/block_fetcher_test.cc index f87b23c3a4c..6d983f9b74a 100644 --- a/table/block_fetcher_test.cc +++ b/table/block_fetcher_test.cc @@ -363,7 +363,6 @@ class BlockFetcherTest : public testing::Test { }; // Skip the following tests in lite mode since direct I/O is unsupported. -#ifndef ROCKSDB_LITE // Fetch index block under both direct IO and non-direct IO. // Expects: @@ -509,7 +508,6 @@ TEST_F(BlockFetcherTest, FetchAndUncompressCompressedDataBlock) { expected_stats_by_mode); } -#endif // ROCKSDB_LITE } // namespace } // namespace ROCKSDB_NAMESPACE diff --git a/table/cuckoo/cuckoo_table_builder.cc b/table/cuckoo/cuckoo_table_builder.cc index 296825d9480..7ca72365fd9 100644 --- a/table/cuckoo/cuckoo_table_builder.cc +++ b/table/cuckoo/cuckoo_table_builder.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "table/cuckoo/cuckoo_table_builder.h" #include @@ -550,4 +549,3 @@ const char* CuckooTableBuilder::GetFileChecksumFuncName() const { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/cuckoo/cuckoo_table_builder.h b/table/cuckoo/cuckoo_table_builder.h index a125e1f4c5e..3a19dd6f997 100644 --- a/table/cuckoo/cuckoo_table_builder.h +++ b/table/cuckoo/cuckoo_table_builder.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -135,4 +134,3 @@ class CuckooTableBuilder : public TableBuilder { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/cuckoo/cuckoo_table_builder_test.cc b/table/cuckoo/cuckoo_table_builder_test.cc index be1c62117da..ec3ec42062e 100644 --- a/table/cuckoo/cuckoo_table_builder_test.cc +++ b/table/cuckoo/cuckoo_table_builder_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "table/cuckoo/cuckoo_table_builder.h" @@ -629,12 +628,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as Cuckoo table is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/table/cuckoo/cuckoo_table_factory.cc b/table/cuckoo/cuckoo_table_factory.cc index 1253c92dd6a..774e00212d9 100644 --- a/table/cuckoo/cuckoo_table_factory.cc +++ b/table/cuckoo/cuckoo_table_factory.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "table/cuckoo/cuckoo_table_factory.h" #include "db/dbformat.h" @@ -67,7 +66,6 @@ std::string CuckooTableFactory::GetPrintableOptions() const { static std::unordered_map cuckoo_table_type_info = { -#ifndef ROCKSDB_LITE {"hash_table_ratio", {offsetof(struct CuckooTableOptions, hash_table_ratio), OptionType::kDouble, OptionVerificationType::kNormal, @@ -88,7 +86,6 @@ static std::unordered_map cuckoo_table_type_info = {offsetof(struct CuckooTableOptions, use_module_hash), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; CuckooTableFactory::CuckooTableFactory(const CuckooTableOptions& table_options) @@ -101,4 +98,3 @@ TableFactory* NewCuckooTableFactory(const CuckooTableOptions& table_options) { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/cuckoo/cuckoo_table_factory.h b/table/cuckoo/cuckoo_table_factory.h index 9937c28dd29..7132cec659a 100644 --- a/table/cuckoo/cuckoo_table_factory.h +++ b/table/cuckoo/cuckoo_table_factory.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -79,4 +78,3 @@ class CuckooTableFactory : public TableFactory { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/cuckoo/cuckoo_table_reader.cc b/table/cuckoo/cuckoo_table_reader.cc index 1d70909a601..fa3e77b2eb3 100644 --- a/table/cuckoo/cuckoo_table_reader.cc +++ b/table/cuckoo/cuckoo_table_reader.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "table/cuckoo/cuckoo_table_reader.h" #include @@ -408,4 +407,3 @@ InternalIterator* CuckooTableReader::NewIterator( size_t CuckooTableReader::ApproximateMemoryUsage() const { return 0; } } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/table/cuckoo/cuckoo_table_reader.h b/table/cuckoo/cuckoo_table_reader.h index f6c599ae808..7e154769dcc 100644 --- a/table/cuckoo/cuckoo_table_reader.h +++ b/table/cuckoo/cuckoo_table_reader.h @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #pragma once -#ifndef ROCKSDB_LITE #include #include #include @@ -97,4 +96,3 @@ class CuckooTableReader : public TableReader { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/cuckoo/cuckoo_table_reader_test.cc b/table/cuckoo/cuckoo_table_reader_test.cc index d3d1490c6ef..e83baa10779 100644 --- a/table/cuckoo/cuckoo_table_reader_test.cc +++ b/table/cuckoo/cuckoo_table_reader_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include @@ -573,12 +572,3 @@ int main(int argc, char** argv) { #endif // GFLAGS. -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as Cuckoo table is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/table/format.cc b/table/format.cc index d3347cdb8c1..b8785b11354 100644 --- a/table/format.cc +++ b/table/format.cc @@ -38,14 +38,8 @@ namespace ROCKSDB_NAMESPACE { extern const uint64_t kLegacyBlockBasedTableMagicNumber; extern const uint64_t kBlockBasedTableMagicNumber; -#ifndef ROCKSDB_LITE extern const uint64_t kLegacyPlainTableMagicNumber; extern const uint64_t kPlainTableMagicNumber; -#else -// ROCKSDB_LITE doesn't have plain table -const uint64_t kLegacyPlainTableMagicNumber = 0; -const uint64_t kPlainTableMagicNumber = 0; -#endif const char* kHostnameForDbHostId = "__hostname__"; bool ShouldReportDetailedTime(Env* env, Statistics* stats) { diff --git a/table/get_context.cc b/table/get_context.cc index 2b5a7ae6596..d4b2e35d23b 100644 --- a/table/get_context.cc +++ b/table/get_context.cc @@ -22,7 +22,6 @@ namespace ROCKSDB_NAMESPACE { namespace { void appendToReplayLog(std::string* replay_log, ValueType type, Slice value) { -#ifndef ROCKSDB_LITE if (replay_log) { if (replay_log->empty()) { // Optimization: in the common case of only one operation in the @@ -32,11 +31,6 @@ void appendToReplayLog(std::string* replay_log, ValueType type, Slice value) { replay_log->push_back(type); PutLengthPrefixedSlice(replay_log, value); } -#else - (void)replay_log; - (void)type; - (void)value; -#endif // ROCKSDB_LITE } } // namespace @@ -584,7 +578,6 @@ void GetContext::push_operand(const Slice& value, Cleanable* value_pinner) { void replayGetContextLog(const Slice& replay_log, const Slice& user_key, GetContext* get_context, Cleanable* value_pinner) { -#ifndef ROCKSDB_LITE Slice s = replay_log; while (s.size()) { auto type = static_cast(*s.data()); @@ -601,13 +594,6 @@ void replayGetContextLog(const Slice& replay_log, const Slice& user_key, ParsedInternalKey(user_key, kMaxSequenceNumber, type), value, &dont_care, value_pinner); } -#else // ROCKSDB_LITE - (void)replay_log; - (void)user_key; - (void)get_context; - (void)value_pinner; - assert(false); -#endif // ROCKSDB_LITE } } // namespace ROCKSDB_NAMESPACE diff --git a/table/plain/plain_table_builder.cc b/table/plain/plain_table_builder.cc index 04723955cf8..126098a868e 100644 --- a/table/plain/plain_table_builder.cc +++ b/table/plain/plain_table_builder.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "table/plain/plain_table_builder.h" #include @@ -334,4 +333,3 @@ void PlainTableBuilder::SetSeqnoTimeTableProperties(const std::string& string, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/plain/plain_table_builder.h b/table/plain/plain_table_builder.h index 445491c2ab4..863882baf26 100644 --- a/table/plain/plain_table_builder.h +++ b/table/plain/plain_table_builder.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -151,4 +150,3 @@ class PlainTableBuilder : public TableBuilder { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/plain/plain_table_factory.cc b/table/plain/plain_table_factory.cc index dfe5241a53e..c1402d8ef27 100644 --- a/table/plain/plain_table_factory.cc +++ b/table/plain/plain_table_factory.cc @@ -20,7 +20,6 @@ #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE static std::unordered_map plain_table_type_info = { {"user_key_len", {offsetof(struct PlainTableOptions, user_key_len), OptionType::kUInt32T, @@ -153,9 +152,7 @@ Status GetPlainTableOptionsFromString(const ConfigOptions& config_options, return Status::InvalidArgument(s.getState()); } } -#endif // ROCKSDB_LITE -#ifndef ROCKSDB_LITE static int RegisterBuiltinMemTableRepFactory(ObjectLibrary& library, const std::string& /*arg*/) { // The MemTableRepFactory built-in classes will be either a class @@ -232,7 +229,6 @@ static int RegisterBuiltinMemTableRepFactory(ObjectLibrary& library, size_t num_types; return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE Status GetMemTableRepFactoryFromString( const std::string& opts_str, std::unique_ptr* result) { @@ -245,12 +241,10 @@ Status GetMemTableRepFactoryFromString( Status MemTableRepFactory::CreateFromString( const ConfigOptions& config_options, const std::string& value, std::unique_ptr* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinMemTableRepFactory(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE std::string id; std::unordered_map opt_map; Status status = Customizable::GetOptionsMap(config_options, result->get(), @@ -264,31 +258,8 @@ Status MemTableRepFactory::CreateFromString( } else if (id.empty()) { // We have no Id but have options. Not good return Status::NotSupported("Cannot reset object ", id); } else { -#ifndef ROCKSDB_LITE status = NewUniqueObject(config_options, id, opt_map, result); -#else - // To make it possible to configure the memtables in LITE mode, the ID - // is of the form :, where name is the name of the class and - // is the length of the object (e.g. skip_list:10). - std::vector opts_list = StringSplit(id, ':'); - if (opts_list.empty() || opts_list.size() > 2 || !opt_map.empty()) { - status = Status::InvalidArgument("Can't parse memtable_factory option ", - value); - } else if (opts_list[0] == SkipListFactory::kNickName() || - opts_list[0] == SkipListFactory::kClassName()) { - // Expecting format - // skip_list: - if (opts_list.size() == 2) { - size_t lookahead = ParseSizeT(opts_list[1]); - result->reset(new SkipListFactory(lookahead)); - } else { - result->reset(new SkipListFactory()); - } - } else if (!config_options.ignore_unsupported_options) { - status = Status::NotSupported("Cannot load object in LITE mode ", id); - } -#endif // ROCKSDB_LITE } return status; } @@ -304,7 +275,6 @@ Status MemTableRepFactory::CreateFromString( return s; } -#ifndef ROCKSDB_LITE Status GetPlainTableOptionsFromMap( const PlainTableOptions& table_options, const std::unordered_map& opts_map, @@ -346,5 +316,4 @@ const std::string PlainTablePropertyNames::kBloomVersion = const std::string PlainTablePropertyNames::kNumBloomBlocks = "rocksdb.plain.table.bloom.numblocks"; -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/table/plain/plain_table_factory.h b/table/plain/plain_table_factory.h index ce60b9d1990..a47418af69f 100644 --- a/table/plain/plain_table_factory.h +++ b/table/plain/plain_table_factory.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -179,4 +178,3 @@ class PlainTableFactory : public TableFactory { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/plain/plain_table_index.cc b/table/plain/plain_table_index.cc index b7e07cfb224..c85176d6ca7 100644 --- a/table/plain/plain_table_index.cc +++ b/table/plain/plain_table_index.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "table/plain/plain_table_index.h" #include @@ -210,4 +209,3 @@ const std::string PlainTableIndexBuilder::kPlainTableIndexBlock = "PlainTableIndexBlock"; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/plain/plain_table_index.h b/table/plain/plain_table_index.h index 9f5f0eeff1e..0adb6417d95 100644 --- a/table/plain/plain_table_index.h +++ b/table/plain/plain_table_index.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -245,4 +244,3 @@ class PlainTableIndexBuilder { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/plain/plain_table_key_coding.cc b/table/plain/plain_table_key_coding.cc index 800d8d76fbc..a40968a6089 100644 --- a/table/plain/plain_table_key_coding.cc +++ b/table/plain/plain_table_key_coding.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "table/plain/plain_table_key_coding.h" #include @@ -506,4 +505,3 @@ Status PlainTableKeyDecoder::NextKeyNoValue(uint32_t start_offset, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LIT diff --git a/table/plain/plain_table_key_coding.h b/table/plain/plain_table_key_coding.h index 9cda7df3236..fdef2248251 100644 --- a/table/plain/plain_table_key_coding.h +++ b/table/plain/plain_table_key_coding.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -198,4 +197,3 @@ class PlainTableKeyDecoder { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/plain/plain_table_reader.cc b/table/plain/plain_table_reader.cc index 6ce3d0ab994..3e51c227514 100644 --- a/table/plain/plain_table_reader.cc +++ b/table/plain/plain_table_reader.cc @@ -3,7 +3,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "table/plain/plain_table_reader.h" @@ -762,4 +761,3 @@ Slice PlainTableIterator::value() const { Status PlainTableIterator::status() const { return status_; } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/plain/plain_table_reader.h b/table/plain/plain_table_reader.h index 62bda693aeb..51500c3ee21 100644 --- a/table/plain/plain_table_reader.h +++ b/table/plain/plain_table_reader.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -241,4 +240,3 @@ class PlainTableReader : public TableReader { void operator=(const TableReader&) = delete; }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/sst_file_dumper.cc b/table/sst_file_dumper.cc index 3357099e829..59e62486a87 100644 --- a/table/sst_file_dumper.cc +++ b/table/sst_file_dumper.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "table/sst_file_dumper.h" @@ -516,4 +515,3 @@ Status SstFileDumper::ReadTableProperties( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/sst_file_dumper.h b/table/sst_file_dumper.h index 7be8763909a..1e78959d145 100644 --- a/table/sst_file_dumper.h +++ b/table/sst_file_dumper.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -98,4 +97,3 @@ class SstFileDumper { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/table/sst_file_reader.cc b/table/sst_file_reader.cc index 48f1be0be8f..5573d941cb9 100644 --- a/table/sst_file_reader.cc +++ b/table/sst_file_reader.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/sst_file_reader.h" @@ -98,4 +97,3 @@ Status SstFileReader::VerifyChecksum(const ReadOptions& read_options) { } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/table/sst_file_reader_test.cc b/table/sst_file_reader_test.cc index 4837d223bab..ba81d781500 100644 --- a/table/sst_file_reader_test.cc +++ b/table/sst_file_reader_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/sst_file_reader.h" @@ -422,13 +421,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as SstFileReader is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/table/sst_file_writer.cc b/table/sst_file_writer.cc index 16d11efd3fe..e9f72f04fd0 100644 --- a/table/sst_file_writer.cc +++ b/table/sst_file_writer.cc @@ -23,7 +23,6 @@ const std::string ExternalSstFilePropertyNames::kVersion = const std::string ExternalSstFilePropertyNames::kGlobalSeqno = "rocksdb.external_sst_file.global_seqno"; -#ifndef ROCKSDB_LITE const size_t kFadviseTrigger = 1024 * 1024; // 1MB @@ -422,6 +421,5 @@ Status SstFileWriter::Finish(ExternalSstFileInfo* file_info) { } uint64_t SstFileWriter::FileSize() { return rep_->file_info.file_size; } -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/table/table_factory.cc b/table/table_factory.cc index fc5c5ccde47..ef44fe38250 100644 --- a/table/table_factory.cc +++ b/table/table_factory.cc @@ -16,7 +16,6 @@ namespace ROCKSDB_NAMESPACE { static void RegisterTableFactories(const std::string& /*arg*/) { -#ifndef ROCKSDB_LITE static std::once_flag loaded; std::call_once(loaded, []() { auto library = ObjectLibrary::Default(); @@ -42,7 +41,6 @@ static void RegisterTableFactories(const std::string& /*arg*/) { return guard->get(); }); }); -#endif // ROCKSDB_LITE } static bool LoadFactory(const std::string& name, diff --git a/table/table_reader_bench.cc b/table/table_reader_bench.cc index b13caf68d52..09146f0efb6 100644 --- a/table/table_reader_bench.cc +++ b/table/table_reader_bench.cc @@ -297,18 +297,12 @@ int main(int argc, char** argv) { options.compression = ROCKSDB_NAMESPACE::CompressionType::kNoCompression; if (FLAGS_table_factory == "cuckoo_hash") { -#ifndef ROCKSDB_LITE options.allow_mmap_reads = FLAGS_mmap_read; env_options.use_mmap_reads = FLAGS_mmap_read; ROCKSDB_NAMESPACE::CuckooTableOptions table_options; table_options.hash_table_ratio = 0.75; tf.reset(ROCKSDB_NAMESPACE::NewCuckooTableFactory(table_options)); -#else - fprintf(stderr, "Plain table is not supported in lite mode\n"); - exit(1); -#endif // ROCKSDB_LITE } else if (FLAGS_table_factory == "plain_table") { -#ifndef ROCKSDB_LITE options.allow_mmap_reads = FLAGS_mmap_read; env_options.use_mmap_reads = FLAGS_mmap_read; @@ -320,10 +314,6 @@ int main(int argc, char** argv) { tf.reset(new ROCKSDB_NAMESPACE::PlainTableFactory(plain_table_options)); options.prefix_extractor.reset( ROCKSDB_NAMESPACE::NewFixedPrefixTransform(FLAGS_prefix_len)); -#else - fprintf(stderr, "Cuckoo table is not supported in lite mode\n"); - exit(1); -#endif // ROCKSDB_LITE } else if (FLAGS_table_factory == "block_based") { tf.reset(new ROCKSDB_NAMESPACE::BlockBasedTableFactory()); } else { diff --git a/table/table_test.cc b/table/table_test.cc index d5fff82da4f..de40a284365 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -620,11 +620,9 @@ class DBConstructor : public Constructor { enum TestType { BLOCK_BASED_TABLE_TEST, -#ifndef ROCKSDB_LITE PLAIN_TABLE_SEMI_FIXED_PREFIX, PLAIN_TABLE_FULL_STR_PREFIX, PLAIN_TABLE_TOTAL_ORDER, -#endif // !ROCKSDB_LITE BLOCK_TEST, MEMTABLE_TEST, DB_TEST @@ -654,11 +652,9 @@ std::ostream& operator<<(std::ostream& os, const TestArgs& args) { static std::vector GenerateArgList() { std::vector test_args; std::vector test_types = {BLOCK_BASED_TABLE_TEST, -#ifndef ROCKSDB_LITE PLAIN_TABLE_SEMI_FIXED_PREFIX, PLAIN_TABLE_FULL_STR_PREFIX, PLAIN_TABLE_TOTAL_ORDER, -#endif // !ROCKSDB_LITE BLOCK_TEST, MEMTABLE_TEST, DB_TEST}; @@ -697,7 +693,6 @@ static std::vector GenerateArgList() { for (auto test_type : test_types) { for (auto reverse_compare : reverse_compare_types) { -#ifndef ROCKSDB_LITE if (test_type == PLAIN_TABLE_SEMI_FIXED_PREFIX || test_type == PLAIN_TABLE_FULL_STR_PREFIX || test_type == PLAIN_TABLE_TOTAL_ORDER) { @@ -715,7 +710,6 @@ static std::vector GenerateArgList() { test_args.push_back(one_arg); continue; } -#endif // !ROCKSDB_LITE for (auto restart_interval : restart_intervals) { for (auto compression_type : compression_types) { @@ -804,8 +798,7 @@ class HarnessTest : public testing::Test { internal_comparator_.reset( new InternalKeyComparator(options_.comparator)); break; -// Plain table is not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE + case PLAIN_TABLE_SEMI_FIXED_PREFIX: support_prev_ = false; only_support_prefix_seek_ = true; @@ -845,7 +838,6 @@ class HarnessTest : public testing::Test { internal_comparator_.reset( new InternalKeyComparator(options_.comparator)); break; -#endif // !ROCKSDB_LITE case BLOCK_TEST: table_options_.block_size = 256; options_.table_factory.reset( @@ -3811,8 +3803,6 @@ TEST_P(BlockBasedTableTest, Crc32cFileChecksum) { ASSERT_STREQ(checksum.c_str(), "\345\245\277\110"); } -// Plain table is not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE TEST_F(PlainTableTest, BasicPlainTableProperties) { PlainTableOptions plain_table_options; plain_table_options.user_key_len = 8; @@ -3942,7 +3932,6 @@ TEST_F(PlainTableTest, Crc32cFileChecksum) { EXPECT_STREQ(f.GetFileChecksum().c_str(), checksum.c_str()); } -#endif // !ROCKSDB_LITE TEST_F(GeneralTableTest, ApproximateOffsetOfPlain) { TableConstructor c(BytewiseComparator(), true /* convert_to_internal_key_ */); @@ -4115,7 +4104,6 @@ TEST_P(ParameterizedHarnessTest, RandomizedHarnessTest) { } } -#ifndef ROCKSDB_LITE TEST_F(DBHarnessTest, RandomizedLongDB) { Random rnd(test::RandomSeed()); int num_entries = 100000; @@ -4136,7 +4124,6 @@ TEST_F(DBHarnessTest, RandomizedLongDB) { } ASSERT_GT(files, 0); } -#endif // ROCKSDB_LITE #endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class MemTableTest : public testing::Test { @@ -4281,8 +4268,7 @@ TEST(TableTest, FooterTests) { ASSERT_EQ(decoded_footer.GetBlockTrailerSize(), 5U); } } -// Plain table is not supported in ROCKSDB_LITE -#ifndef ROCKSDB_LITE + { // legacy plain table FooterBuilder footer; @@ -4319,7 +4305,6 @@ TEST(TableTest, FooterTests) { ASSERT_EQ(decoded_footer.format_version(), 1U); ASSERT_EQ(decoded_footer.GetBlockTrailerSize(), 0U); } -#endif // !ROCKSDB_LITE } class IndexBlockRestartIntervalTest diff --git a/test_util/testutil.cc b/test_util/testutil.cc index 5e1b909f973..031104a7b59 100644 --- a/test_util/testutil.cc +++ b/test_util/testutil.cc @@ -242,7 +242,6 @@ BlockBasedTableOptions RandomBlockBasedTableOptions(Random* rnd) { } TableFactory* RandomTableFactory(Random* rnd, int pre_defined) { -#ifndef ROCKSDB_LITE int random_num = pre_defined >= 0 ? pre_defined : rnd->Uniform(4); switch (random_num) { case 0: @@ -252,11 +251,6 @@ TableFactory* RandomTableFactory(Random* rnd, int pre_defined) { default: return NewBlockBasedTableFactory(); } -#else - (void)rnd; - (void)pre_defined; - return NewBlockBasedTableFactory(); -#endif // !ROCKSDB_LITE } MergeOperator* RandomMergeOperator(Random* rnd) { @@ -501,13 +495,11 @@ Status CorruptFile(Env* env, const std::string& fname, int offset, s = WriteStringToFile(env, contents, fname); } if (s.ok() && verify_checksum) { -#ifndef ROCKSDB_LITE Options options; options.env = env; EnvOptions env_options; Status v = VerifySstFileChecksum(options, env_options, fname); assert(!v.ok()); -#endif } return s; } @@ -620,7 +612,6 @@ class SpecialMemTableRep : public MemTableRep { }; class SpecialSkipListFactory : public MemTableRepFactory { public: -#ifndef ROCKSDB_LITE static bool Register(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( ObjectLibrary::PatternEntry(SpecialSkipListFactory::kClassName(), true) @@ -638,7 +629,6 @@ class SpecialSkipListFactory : public MemTableRepFactory { }); return true; } -#endif // ROCKSDB_LITE // After number of inserts exceeds `num_entries_flush` in a mem table, trigger // flush. explicit SpecialSkipListFactory(int num_entries_flush) @@ -678,7 +668,6 @@ MemTableRepFactory* NewSpecialSkipListFactory(int num_entries_per_flush) { return new SpecialSkipListFactory(num_entries_per_flush); } -#ifndef ROCKSDB_LITE // This method loads existing test classes into the ObjectRegistry int RegisterTestObjects(ObjectLibrary& library, const std::string& arg) { size_t num_types; @@ -721,17 +710,12 @@ int RegisterTestObjects(ObjectLibrary& library, const std::string& arg) { return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE void RegisterTestLibrary(const std::string& arg) { static bool registered = false; if (!registered) { registered = true; -#ifndef ROCKSDB_LITE ObjectRegistry::Default()->AddLibrary("test", RegisterTestObjects, arg); -#else - (void)arg; -#endif // ROCKSDB_LITE } } } // namespace test diff --git a/test_util/testutil.h b/test_util/testutil.h index c2289dd819f..686817c445d 100644 --- a/test_util/testutil.h +++ b/test_util/testutil.h @@ -851,10 +851,8 @@ void DeleteDir(Env* env, const std::string& dirname); Status CreateEnvFromSystem(const ConfigOptions& options, Env** result, std::shared_ptr* guard); -#ifndef ROCKSDB_LITE // Registers the testutil classes with the ObjectLibrary int RegisterTestObjects(ObjectLibrary& library, const std::string& /*arg*/); -#endif // ROCKSDB_LITE // Register the testutil classes with the default ObjectRegistry/Library void RegisterTestLibrary(const std::string& arg = ""); diff --git a/test_util/transaction_test_util.cc b/test_util/transaction_test_util.cc index 99286d83617..11fca6d5757 100644 --- a/test_util/transaction_test_util.cc +++ b/test_util/transaction_test_util.cc @@ -2,7 +2,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "test_util/transaction_test_util.h" @@ -399,4 +398,3 @@ Status RandomTransactionInserter::Verify(DB* db, uint16_t num_sets, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/test_util/transaction_test_util.h b/test_util/transaction_test_util.h index 7a38ab62681..284b3925031 100644 --- a/test_util/transaction_test_util.h +++ b/test_util/transaction_test_util.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include "port/port.h" #include "rocksdb/options.h" @@ -146,4 +145,3 @@ class RandomTransactionInserter { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/blob_dump.cc b/tools/blob_dump.cc index 1f75eb20d8a..23b5f8f7903 100644 --- a/tools/blob_dump.cc +++ b/tools/blob_dump.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include #include @@ -102,10 +101,3 @@ int main(int argc, char** argv) { } return 0; } -#else -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Not supported in lite mode.\n"); - return -1; -} -#endif // ROCKSDB_LITE diff --git a/tools/block_cache_analyzer/block_cache_trace_analyzer.cc b/tools/block_cache_analyzer/block_cache_trace_analyzer.cc index f0bb6975bad..f2d4f05bea7 100644 --- a/tools/block_cache_analyzer/block_cache_trace_analyzer.cc +++ b/tools/block_cache_analyzer/block_cache_trace_analyzer.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifdef GFLAGS #include "tools/block_cache_analyzer/block_cache_trace_analyzer.h" @@ -2313,4 +2312,3 @@ int block_cache_trace_analyzer_tool(int argc, char** argv) { } // namespace ROCKSDB_NAMESPACE #endif // GFLAGS -#endif // ROCKSDB_LITE diff --git a/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc b/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc index 60834480538..174565641f7 100644 --- a/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +++ b/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include int main() { @@ -790,11 +789,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } #endif // GFLAG -#else -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "block_cache_trace_analyzer_test is not supported in ROCKSDB_LITE\n"); - return 0; -} -#endif // ROCKSDB_LITE diff --git a/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc b/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc index 44fec559892..6e0be54d6e0 100644 --- a/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc +++ b/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include int main() { @@ -16,10 +15,3 @@ int main(int argc, char** argv) { return ROCKSDB_NAMESPACE::block_cache_trace_analyzer_tool(argc, argv); } #endif // GFLAGS -#else // ROCKSDB_LITE -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Not supported in lite mode.\n"); - return 1; -} -#endif // ROCKSDB_LITE diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 17523608b71..e6afc625f65 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -65,9 +65,7 @@ #include "rocksdb/utilities/optimistic_transaction_db.h" #include "rocksdb/utilities/options_type.h" #include "rocksdb/utilities/options_util.h" -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/replayer.h" -#endif // ROCKSDB_LITE #include "rocksdb/utilities/sim_cache.h" #include "rocksdb/utilities/transaction.h" #include "rocksdb/utilities/transaction_db.h" @@ -105,12 +103,6 @@ using GFLAGS_NAMESPACE::RegisterFlagValidator; using GFLAGS_NAMESPACE::SetUsageMessage; using GFLAGS_NAMESPACE::SetVersionString; -#ifdef ROCKSDB_LITE -#define IF_ROCKSDB_LITE(Then, Else) Then -#else -#define IF_ROCKSDB_LITE(Then, Else) Else -#endif - DEFINE_string( benchmarks, "fillseq," @@ -130,11 +122,9 @@ DEFINE_string( "compact," "compactall," "flush," -IF_ROCKSDB_LITE("", "compact0," "compact1," "waitforcompaction," -) "multireadrandom," "mixgraph," "readseq," @@ -231,11 +221,9 @@ IF_ROCKSDB_LITE("", "Meta operations:\n" "\tcompact -- Compact the entire DB; If multiple, randomly choose one\n" "\tcompactall -- Compact the entire DB\n" -IF_ROCKSDB_LITE("", "\tcompact0 -- compact L0 into L1\n" "\tcompact1 -- compact L1 into L2\n" "\twaitforcompaction - pause until compaction is (probably) done\n" -) "\tflush - flush the memtable\n" "\tstats -- Print DB stats\n" "\tresetstats -- Reset DB stats\n" @@ -243,9 +231,7 @@ IF_ROCKSDB_LITE("", "\tmemstats -- Print memtable stats\n" "\tsstables -- Print sstable info\n" "\theapprofile -- Dump a heap profile (if supported by this port)\n" -IF_ROCKSDB_LITE("", "\treplay -- replay the trace file specified with trace_file\n" -) "\tgetmergeoperands -- Insert lots of merge records which are a list of " "sorted ints for a key and then compare performance of lookup for another " "key by doing a Get followed by binary searching in the large sorted list " @@ -945,7 +931,6 @@ DEFINE_int64(max_num_range_tombstones, 0, DEFINE_bool(expand_range_tombstones, false, "Expand range tombstone into sequential regular tombstones."); -#ifndef ROCKSDB_LITE // Transactions Options DEFINE_bool(optimistic_transaction_db, false, "Open a OptimisticTransactionDB instance. " @@ -1049,7 +1034,6 @@ DEFINE_string( static enum ROCKSDB_NAMESPACE::CompressionType FLAGS_blob_db_compression_type_e = ROCKSDB_NAMESPACE::kSnappyCompression; -#endif // ROCKSDB_LITE // Integrated BlobDB options DEFINE_bool( @@ -1121,7 +1105,6 @@ DEFINE_int32(prepopulate_blob_cache, 0, "[Integrated BlobDB] Pre-populate hot/warm blobs in blob cache. 0 " "to disable and 1 to insert during flush."); -#ifndef ROCKSDB_LITE // Secondary DB instance Options DEFINE_bool(use_secondary_db, false, @@ -1136,7 +1119,6 @@ DEFINE_int32(secondary_update_interval, 5, "Secondary instance attempts to catch up with the primary every " "secondary_update_interval seconds."); -#endif // ROCKSDB_LITE DEFINE_bool(report_bg_io_stats, false, "Measure times spents on I/Os while in compactions. "); @@ -1144,7 +1126,6 @@ DEFINE_bool(report_bg_io_stats, false, DEFINE_bool(use_stderr_info_logger, false, "Write info logs to stderr instead of to LOG file. "); -#ifndef ROCKSDB_LITE DEFINE_string(trace_file, "", "Trace workload to a file. "); @@ -1166,7 +1147,6 @@ DEFINE_int32(trace_replay_threads, 1, DEFINE_bool(io_uring_enabled, true, "If true, enable the use of IO uring if the platform supports it"); extern "C" bool RocksDbIOUringEnable() { return FLAGS_io_uring_enabled; } -#endif // ROCKSDB_LITE DEFINE_bool(adaptive_readahead, false, "carry forward internal auto readahead size from one file to next " @@ -1343,14 +1323,12 @@ static bool ValidateTableCacheNumshardbits(const char* flagname, } DEFINE_int32(table_cache_numshardbits, 4, ""); -#ifndef ROCKSDB_LITE DEFINE_string(env_uri, "", "URI for registry Env lookup. Mutually exclusive with --fs_uri"); DEFINE_string(fs_uri, "", "URI for registry Filesystem lookup. Mutually exclusive" " with --env_uri." " Creates a default environment with the specified filesystem."); -#endif // ROCKSDB_LITE DEFINE_string(simulate_hybrid_fs_file, "", "File for Store Metadata for Simulate hybrid FS. Empty means " "disable the feature. Now, if it is set, last_level_temperature " @@ -1547,12 +1525,10 @@ DEFINE_uint64(max_compaction_bytes, ROCKSDB_NAMESPACE::Options().max_compaction_bytes, "Max bytes allowed in one compaction"); -#ifndef ROCKSDB_LITE DEFINE_bool(readonly, false, "Run read only benchmarks."); DEFINE_bool(print_malloc_stats, false, "Print malloc stats to stdout after benchmarks finish."); -#endif // ROCKSDB_LITE DEFINE_bool(disable_auto_compactions, false, "Do not auto trigger compactions"); @@ -1708,11 +1684,9 @@ DEFINE_bool(read_with_latest_user_timestamp, true, "If true, always use the current latest timestamp for read. If " "false, choose a random timestamp from the past."); -#ifndef ROCKSDB_LITE DEFINE_string(secondary_cache_uri, "", "Full URI for creating a custom secondary cache object"); static class std::shared_ptr secondary_cache; -#endif // ROCKSDB_LITE static const bool FLAGS_prefix_size_dummy __attribute__((__unused__)) = RegisterFlagValidator(&FLAGS_prefix_size, &ValidatePrefixSize); @@ -1765,7 +1739,6 @@ static Status CreateMemTableRepFactory( Status s; if (!strcasecmp(FLAGS_memtablerep.c_str(), SkipListFactory::kNickName())) { factory->reset(new SkipListFactory(FLAGS_skip_list_lookahead)); -#ifndef ROCKSDB_LITE } else if (!strcasecmp(FLAGS_memtablerep.c_str(), "prefix_hash")) { factory->reset(NewHashSkipListRepFactory(FLAGS_hash_bucket_count)); } else if (!strcasecmp(FLAGS_memtablerep.c_str(), @@ -1773,7 +1746,6 @@ static Status CreateMemTableRepFactory( factory->reset(new VectorRepFactory()); } else if (!strcasecmp(FLAGS_memtablerep.c_str(), "hash_linkedlist")) { factory->reset(NewHashLinkListRepFactory(FLAGS_hash_bucket_count)); -#endif // ROCKSDB_LITE } else { std::unique_ptr unique; s = MemTableRepFactory::CreateFromString(config_options, FLAGS_memtablerep, @@ -1936,9 +1908,7 @@ static void AppendWithSpace(std::string* str, Slice msg) { struct DBWithColumnFamilies { std::vector cfh; DB* db; -#ifndef ROCKSDB_LITE OptimisticTransactionDB* opt_txn_db; -#endif // ROCKSDB_LITE std::atomic num_created; // Need to be updated after all the // new entries in cfh are set. size_t num_hot; // Number of column families to be queried at each moment. @@ -1950,10 +1920,8 @@ struct DBWithColumnFamilies { DBWithColumnFamilies() : db(nullptr) -#ifndef ROCKSDB_LITE , opt_txn_db(nullptr) -#endif // ROCKSDB_LITE { cfh.clear(); num_created = 0; @@ -1963,9 +1931,7 @@ struct DBWithColumnFamilies { DBWithColumnFamilies(const DBWithColumnFamilies& other) : cfh(other.cfh), db(other.db), -#ifndef ROCKSDB_LITE opt_txn_db(other.opt_txn_db), -#endif // ROCKSDB_LITE num_created(other.num_created.load()), num_hot(other.num_hot), cfh_idx_to_prob(other.cfh_idx_to_prob) { @@ -1975,7 +1941,6 @@ struct DBWithColumnFamilies { std::for_each(cfh.begin(), cfh.end(), [](ColumnFamilyHandle* cfhi) { delete cfhi; }); cfh.clear(); -#ifndef ROCKSDB_LITE if (opt_txn_db) { delete opt_txn_db; opt_txn_db = nullptr; @@ -1983,10 +1948,6 @@ struct DBWithColumnFamilies { delete db; db = nullptr; } -#else - delete db; - db = nullptr; -#endif // ROCKSDB_LITE } ColumnFamilyHandle* GetCfh(int64_t rand_num) { @@ -2703,10 +2664,8 @@ class Benchmark { ReadOptions read_options_; WriteOptions write_options_; Options open_options_; // keep options around to properly destroy db later -#ifndef ROCKSDB_LITE TraceOptions trace_options_; TraceOptions block_cache_trace_options_; -#endif int64_t reads_; int64_t deletes_; double read_random_exp_range_; @@ -2720,7 +2679,6 @@ class Benchmark { class ErrorHandlerListener : public EventListener { public: -#ifndef ROCKSDB_LITE ErrorHandlerListener() : mutex_(), cv_(&mutex_), @@ -2765,10 +2723,6 @@ class Benchmark { InstrumentedCondVar cv_; bool no_auto_recovery_; bool recovery_complete_; -#else // ROCKSDB_LITE - bool WaitForRecovery(uint64_t /*abs_time_us*/) { return true; } - void EnableAutoRecovery(bool /*enable*/) {} -#endif // ROCKSDB_LITE }; std::shared_ptr listener_; @@ -3063,7 +3017,6 @@ class Benchmark { GetCacheAllocator(), kDefaultToAdaptiveMutex, kDefaultCacheMetadataChargePolicy, FLAGS_cache_low_pri_pool_ratio); -#ifndef ROCKSDB_LITE if (!FLAGS_secondary_cache_uri.empty()) { Status s = SecondaryCache::CreateFromString( ConfigOptions(), FLAGS_secondary_cache_uri, &secondary_cache); @@ -3076,7 +3029,6 @@ class Benchmark { } opts.secondary_cache = secondary_cache; } -#endif // ROCKSDB_LITE if (FLAGS_use_compressed_secondary_cache) { CompressedSecondaryCacheOptions secondary_cache_opts; @@ -3125,11 +3077,7 @@ class Benchmark { : ((FLAGS_writes > FLAGS_reads) ? FLAGS_writes : FLAGS_reads)), merge_keys_(FLAGS_merge_keys < 0 ? FLAGS_num : FLAGS_merge_keys), report_file_operations_(FLAGS_report_file_operations), -#ifndef ROCKSDB_LITE use_blob_db_(FLAGS_use_blob_db), // Stacked BlobDB -#else - use_blob_db_(false), // Stacked BlobDB -#endif // !ROCKSDB_LITE read_operands_(false) { // use simcache instead of cache if (FLAGS_simcache_size >= 0) { @@ -3165,12 +3113,10 @@ class Benchmark { if (!FLAGS_wal_dir.empty()) { options.wal_dir = FLAGS_wal_dir; } -#ifndef ROCKSDB_LITE if (use_blob_db_) { // Stacked BlobDB blob_db::DestroyBlobDB(FLAGS_db, options, blob_db::BlobDBOptions()); } -#endif // !ROCKSDB_LITE DestroyDB(FLAGS_db, options); if (!FLAGS_wal_dir.empty()) { FLAGS_env->DeleteDir(FLAGS_wal_dir); @@ -3567,14 +3513,12 @@ class Benchmark { method = &Benchmark::Compact; } else if (name == "compactall") { CompactAll(); -#ifndef ROCKSDB_LITE } else if (name == "compact0") { CompactLevel(0); } else if (name == "compact1") { CompactLevel(1); } else if (name == "waitforcompaction") { WaitForCompaction(); -#endif } else if (name == "flush") { Flush(); } else if (name == "crc32c") { @@ -3591,11 +3535,9 @@ class Benchmark { method = &Benchmark::Compress; } else if (name == "uncompress") { method = &Benchmark::Uncompress; -#ifndef ROCKSDB_LITE } else if (name == "randomtransaction") { method = &Benchmark::RandomTransaction; post_process_method = &Benchmark::RandomTransactionVerify; -#endif // ROCKSDB_LITE } else if (name == "randomreplacekeys") { fresh_db = true; method = &Benchmark::RandomReplaceKeys; @@ -3631,7 +3573,6 @@ class Benchmark { PrintStats("rocksdb.sstables"); } else if (name == "stats_history") { PrintStatsHistory(); -#ifndef ROCKSDB_LITE } else if (name == "replay") { if (num_threads > 1) { fprintf(stderr, "Multi-threaded replay is not yet supported\n"); @@ -3642,24 +3583,19 @@ class Benchmark { ErrorExit(); } method = &Benchmark::Replay; -#endif // ROCKSDB_LITE } else if (name == "getmergeoperands") { method = &Benchmark::GetMergeOperands; -#ifndef ROCKSDB_LITE } else if (name == "verifychecksum") { method = &Benchmark::VerifyChecksum; } else if (name == "verifyfilechecksums") { method = &Benchmark::VerifyFileChecksums; -#endif // ROCKSDB_LITE } else if (name == "readrandomoperands") { read_operands_ = true; method = &Benchmark::ReadRandom; -#ifndef ROCKSDB_LITE } else if (name == "backup") { method = &Benchmark::Backup; } else if (name == "restore") { method = &Benchmark::Restore; -#endif } else if (!name.empty()) { // No error message for empty name fprintf(stderr, "unknown benchmark '%s'\n", name.c_str()); ErrorExit(); @@ -3691,7 +3627,6 @@ class Benchmark { if (method != nullptr) { fprintf(stdout, "DB path: [%s]\n", FLAGS_db.c_str()); -#ifndef ROCKSDB_LITE if (name == "backup") { std::cout << "Backup path: [" << FLAGS_backup_dir << "]" << std::endl; } else if (name == "restore") { @@ -3762,7 +3697,6 @@ class Benchmark { fprintf(stdout, "Tracing block cache accesses to: [%s]\n", FLAGS_block_cache_trace_file.c_str()); } -#endif // ROCKSDB_LITE if (num_warmup > 0) { printf("Warming up benchmark by running %d times\n", num_warmup); @@ -3801,7 +3735,6 @@ class Benchmark { secondary_update_thread_.reset(); } -#ifndef ROCKSDB_LITE if (name != "replay" && FLAGS_trace_file != "") { Status s = db_.db->EndTrace(); if (!s.ok()) { @@ -3817,7 +3750,6 @@ class Benchmark { s.ToString().c_str()); } } -#endif // ROCKSDB_LITE if (FLAGS_statistics) { fprintf(stdout, "STATISTICS:\n%s\n", dbstats->ToString().c_str()); @@ -3828,21 +3760,17 @@ class Benchmark { static_cast_with_check(cache_.get())->ToString().c_str()); } -#ifndef ROCKSDB_LITE if (FLAGS_use_secondary_db) { fprintf(stdout, "Secondary instance updated %" PRIu64 " times.\n", secondary_db_updates_); } -#endif // ROCKSDB_LITE } private: std::shared_ptr timestamp_emulator_; std::unique_ptr secondary_update_thread_; std::atomic secondary_update_stopped_{0}; -#ifndef ROCKSDB_LITE uint64_t secondary_db_updates_ = 0; -#endif // ROCKSDB_LITE struct ThreadArg { Benchmark* bm; SharedState* shared; @@ -4090,7 +4018,6 @@ class Benchmark { // Returns true if the options is initialized from the specified // options file. bool InitializeOptionsFromFile(Options* opts) { -#ifndef ROCKSDB_LITE printf("Initializing RocksDB Options from the specified file\n"); DBOptions db_opts; std::vector cf_descs; @@ -4110,9 +4037,6 @@ class Benchmark { FLAGS_options_file.c_str(), s.ToString().c_str()); exit(1); } -#else - (void)opts; -#endif return false; } @@ -4174,13 +4098,11 @@ class Benchmark { FLAGS_use_direct_io_for_flush_and_compaction; options.manual_wal_flush = FLAGS_manual_wal_flush; options.wal_compression = FLAGS_wal_compression_e; -#ifndef ROCKSDB_LITE options.ttl = FLAGS_fifo_compaction_ttl; options.compaction_options_fifo = CompactionOptionsFIFO( FLAGS_fifo_compaction_max_table_files_size_mb * 1024 * 1024, FLAGS_fifo_compaction_allow_compaction); options.compaction_options_fifo.age_for_warm = FLAGS_fifo_age_for_warm; -#endif // ROCKSDB_LITE options.prefix_extractor = prefix_extractor_; if (FLAGS_use_uint64_comparator) { options.comparator = test::Uint64Comparator(); @@ -4230,7 +4152,6 @@ class Benchmark { exit(1); } if (FLAGS_use_plain_table) { -#ifndef ROCKSDB_LITE if (!options.memtable_factory->IsInstanceOf("prefix_hash") && !options.memtable_factory->IsInstanceOf("hash_linkedlist")) { fprintf(stderr, "Warning: plain table is used with %s\n", @@ -4248,12 +4169,7 @@ class Benchmark { plain_table_options.hash_table_ratio = 0.75; options.table_factory = std::shared_ptr( NewPlainTableFactory(plain_table_options)); -#else - fprintf(stderr, "Plain table is not supported in lite mode\n"); - exit(1); -#endif // ROCKSDB_LITE } else if (FLAGS_use_cuckoo_table) { -#ifndef ROCKSDB_LITE if (FLAGS_cuckoo_hash_ratio > 1 || FLAGS_cuckoo_hash_ratio < 0) { fprintf(stderr, "Invalid cuckoo_hash_ratio\n"); exit(1); @@ -4269,10 +4185,6 @@ class Benchmark { table_options.identity_as_first_hash = FLAGS_identity_as_first_hash; options.table_factory = std::shared_ptr(NewCuckooTableFactory(table_options)); -#else - fprintf(stderr, "Cuckoo table is not supported in lite mode\n"); - exit(1); -#endif // ROCKSDB_LITE } else { BlockBasedTableOptions block_based_options; block_based_options.checksum = @@ -4416,7 +4328,6 @@ class Benchmark { block_based_options.data_block_hash_table_util_ratio = FLAGS_data_block_hash_table_util_ratio; if (FLAGS_read_cache_path != "") { -#ifndef ROCKSDB_LITE Status rc_status; // Read cache need to be provided with a the Logger, we will put all @@ -4448,11 +4359,6 @@ class Benchmark { rc_status.ToString().c_str()); exit(1); } -#else - fprintf(stderr, "Read cache is not supported in LITE\n"); - exit(1); - -#endif } if (FLAGS_use_blob_cache) { @@ -4648,7 +4554,6 @@ class Benchmark { FLAGS_blob_compaction_readahead_size; options.blob_file_starting_level = FLAGS_blob_file_starting_level; -#ifndef ROCKSDB_LITE if (FLAGS_readonly && FLAGS_transaction_db) { fprintf(stderr, "Cannot use readonly flag with transaction_db\n"); exit(1); @@ -4658,7 +4563,6 @@ class Benchmark { fprintf(stderr, "Cannot use use_secondary_db flag with transaction_db\n"); exit(1); } -#endif // ROCKSDB_LITE options.memtable_protection_bytes_per_key = FLAGS_memtable_protection_bytes_per_key; } @@ -4839,7 +4743,6 @@ class Benchmark { exit(1); } } -#ifndef ROCKSDB_LITE if (FLAGS_readonly) { s = DB::OpenForReadOnly(options, db_name, column_families, &db->cfh, &db->db); @@ -4865,14 +4768,10 @@ class Benchmark { } else { s = DB::Open(options, db_name, column_families, &db->cfh, &db->db); } -#else - s = DB::Open(options, db_name, column_families, &db->cfh, &db->db); -#endif // ROCKSDB_LITE db->cfh.resize(FLAGS_num_column_families); db->num_created = num_hot; db->num_hot = num_hot; db->cfh_idx_to_prob = std::move(cfh_idx_to_prob); -#ifndef ROCKSDB_LITE } else if (FLAGS_readonly) { s = DB::OpenForReadOnly(options, db_name, &db->db); } else if (FLAGS_optimistic_transaction_db) { @@ -4938,7 +4837,6 @@ class Benchmark { }, FLAGS_secondary_update_interval, db)); } -#endif // ROCKSDB_LITE } else { s = DB::Open(options, db_name, &db->db); } @@ -5322,7 +5220,6 @@ class Benchmark { val = gen.Generate(); } if (use_blob_db_) { -#ifndef ROCKSDB_LITE // Stacked BlobDB blob_db::BlobDB* blobdb = static_cast(db_with_cfh->db); @@ -5332,7 +5229,6 @@ class Benchmark { } else { s = blobdb->Put(write_options_, key, val); } -#endif // ROCKSDB_LITE } else if (FLAGS_num_column_families <= 1) { batch.Put(key, val); } else { @@ -5377,11 +5273,9 @@ class Benchmark { GenerateKeyFromInt(begin_num + offset, FLAGS_num, &expanded_keys[offset]); if (use_blob_db_) { -#ifndef ROCKSDB_LITE // Stacked BlobDB s = db_with_cfh->db->Delete(write_options_, expanded_keys[offset]); -#endif // ROCKSDB_LITE } else if (FLAGS_num_column_families <= 1) { batch.Delete(expanded_keys[offset]); } else { @@ -5394,12 +5288,10 @@ class Benchmark { GenerateKeyFromInt(begin_num + range_tombstone_width_, FLAGS_num, &end_key); if (use_blob_db_) { -#ifndef ROCKSDB_LITE // Stacked BlobDB s = db_with_cfh->db->DeleteRange( write_options_, db_with_cfh->db->DefaultColumnFamily(), begin_key, end_key); -#endif // ROCKSDB_LITE } else if (FLAGS_num_column_families <= 1) { batch.DeleteRange(begin_key, end_key); } else { @@ -5485,7 +5377,6 @@ class Benchmark { Status DoDeterministicCompact(ThreadState* thread, CompactionStyle compaction_style, WriteMode write_mode) { -#ifndef ROCKSDB_LITE ColumnFamilyMetaData meta; std::vector db_list; if (db_.db != nullptr) { @@ -5786,14 +5677,6 @@ class Benchmark { std::to_string(options_list[i].level0_stop_writes_trigger)}}); } return Status::OK(); -#else - (void)thread; - (void)compaction_style; - (void)write_mode; - fprintf(stderr, "Rocksdb Lite doesn't support filldeterministic\n"); - return Status::NotSupported( - "Rocksdb Lite doesn't support filldeterministic"); -#endif // ROCKSDB_LITE } void ReadSequential(ThreadState* thread) { @@ -7803,7 +7686,6 @@ class Benchmark { } } -#ifndef ROCKSDB_LITE void VerifyChecksum(ThreadState* thread) { DB* db = SelectDB(thread); ReadOptions ro; @@ -7926,7 +7808,6 @@ class Benchmark { fprintf(stdout, "RandomTransactionVerify FAILED!!\n"); } } -#endif // ROCKSDB_LITE // Writes and deletes random keys without overwriting keys. // @@ -8177,7 +8058,6 @@ class Benchmark { } } -#ifndef ROCKSDB_LITE void WaitForCompactionHelper(DBWithColumnFamilies& db) { // This is an imperfect way of waiting for compaction. The loop and sleep // is done because a thread that finishes a compaction job should get a @@ -8314,7 +8194,6 @@ class Benchmark { while (!CompactLevelHelper(db_with_cfh, from_level)) WaitForCompaction(); } } -#endif void Flush() { FlushOptions flush_opt; @@ -8438,7 +8317,6 @@ class Benchmark { } } -#ifndef ROCKSDB_LITE void Replay(ThreadState* thread) { if (db_.db != nullptr) { @@ -8528,7 +8406,6 @@ class Benchmark { delete backup_engine; } -#endif // ROCKSDB_LITE }; int db_bench_tool(int argc, char** argv) { @@ -8544,7 +8421,6 @@ int db_bench_tool(int argc, char** argv) { ParseCommandLineFlags(&argc, &argv, true); FLAGS_compaction_style_e = (ROCKSDB_NAMESPACE::CompactionStyle)FLAGS_compaction_style; -#ifndef ROCKSDB_LITE if (FLAGS_statistics && !FLAGS_statistics_string.empty()) { fprintf(stderr, "Cannot provide both --statistics and --statistics_string.\n"); @@ -8560,7 +8436,6 @@ int db_bench_tool(int argc, char** argv) { exit(1); } } -#endif // ROCKSDB_LITE if (FLAGS_statistics) { dbstats = ROCKSDB_NAMESPACE::CreateDBStatistics(); } @@ -8590,7 +8465,6 @@ int db_bench_tool(int argc, char** argv) { FLAGS_compressed_secondary_cache_compression_type_e = StringToCompressionType( FLAGS_compressed_secondary_cache_compression_type.c_str()); -#ifndef ROCKSDB_LITE // Stacked BlobDB FLAGS_blob_db_compression_type_e = StringToCompressionType(FLAGS_blob_db_compression_type.c_str()); @@ -8622,7 +8496,6 @@ int db_bench_tool(int argc, char** argv) { // Let -readonly imply -use_existing_db FLAGS_use_existing_db |= FLAGS_readonly; -#endif // ROCKSDB_LITE if (FLAGS_build_info) { std::string build_info; @@ -8703,13 +8576,11 @@ int db_bench_tool(int argc, char** argv) { ROCKSDB_NAMESPACE::Benchmark benchmark; benchmark.Run(); -#ifndef ROCKSDB_LITE if (FLAGS_print_malloc_stats) { std::string stats_string; ROCKSDB_NAMESPACE::DumpMallocStats(&stats_string); fprintf(stdout, "Malloc stats:\n%s\n", stats_string.c_str()); } -#endif // ROCKSDB_LITE return 0; } diff --git a/tools/db_repl_stress.cc b/tools/db_repl_stress.cc index ba680f4f20c..c424743d738 100644 --- a/tools/db_repl_stress.cc +++ b/tools/db_repl_stress.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include int main() { @@ -131,10 +130,3 @@ int main(int argc, const char** argv) { #endif // GFLAGS -#else // ROCKSDB_LITE -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Not supported in lite mode.\n"); - return 1; -} -#endif // ROCKSDB_LITE diff --git a/tools/db_sanity_test.cc b/tools/db_sanity_test.cc index 8cc67f5d5a6..f40be5ae2f2 100644 --- a/tools/db_sanity_test.cc +++ b/tools/db_sanity_test.cc @@ -198,7 +198,6 @@ class SanityTestZSTDCompression : public SanityTest { Options options_; }; -#ifndef ROCKSDB_LITE class SanityTestPlainTableFactory : public SanityTest { public: explicit SanityTestPlainTableFactory(const std::string& path) @@ -214,7 +213,6 @@ class SanityTestPlainTableFactory : public SanityTest { private: Options options_; }; -#endif // ROCKSDB_LITE class SanityTestBloomFilter : public SanityTest { public: @@ -244,9 +242,7 @@ bool RunSanityTests(const std::string& command, const std::string& path) { new SanityTestLZ4Compression(path), new SanityTestLZ4HCCompression(path), new SanityTestZSTDCompression(path), -#ifndef ROCKSDB_LITE new SanityTestPlainTableFactory(path), -#endif // ROCKSDB_LITE new SanityTestBloomFilter(path)}; if (command == "create") { diff --git a/tools/dump/db_dump_tool.cc b/tools/dump/db_dump_tool.cc index 427a54d99eb..535e70c4331 100644 --- a/tools/dump/db_dump_tool.cc +++ b/tools/dump/db_dump_tool.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/db_dump_tool.h" @@ -257,4 +256,3 @@ bool DbUndumpTool::Run(const UndumpOptions& undump_options, return true; } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/dump/rocksdb_dump.cc b/tools/dump/rocksdb_dump.cc index 358457e9232..c2042bf7c0f 100644 --- a/tools/dump/rocksdb_dump.cc +++ b/tools/dump/rocksdb_dump.cc @@ -3,15 +3,12 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#if !(defined GFLAGS) || defined(ROCKSDB_LITE) +#if !(defined GFLAGS) #include int main() { #ifndef GFLAGS fprintf(stderr, "Please install gflags to run rocksdb tools\n"); -#endif -#ifdef ROCKSDB_LITE - fprintf(stderr, "DbDumpTool is not supported in ROCKSDB_LITE\n"); #endif return 1; } @@ -60,4 +57,4 @@ int main(int argc, char** argv) { } return 0; } -#endif // !(defined GFLAGS) || defined(ROCKSDB_LITE) +#endif // !(defined GFLAGS) diff --git a/tools/dump/rocksdb_undump.cc b/tools/dump/rocksdb_undump.cc index 2ff128548d2..e437b3fe8a4 100644 --- a/tools/dump/rocksdb_undump.cc +++ b/tools/dump/rocksdb_undump.cc @@ -3,15 +3,12 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#if !(defined GFLAGS) || defined(ROCKSDB_LITE) +#if !(defined GFLAGS) #include int main() { #ifndef GFLAGS fprintf(stderr, "Please install gflags to run rocksdb tools\n"); -#endif -#ifdef ROCKSDB_LITE - fprintf(stderr, "DbUndumpTool is not supported in ROCKSDB_LITE\n"); #endif return 1; } @@ -59,4 +56,4 @@ int main(int argc, char **argv) { } return 0; } -#endif // !(defined GFLAGS) || defined(ROCKSDB_LITE) +#endif // !(defined GFLAGS) diff --git a/tools/io_tracer_parser.cc b/tools/io_tracer_parser.cc index 41ef45d978c..287d60c850a 100644 --- a/tools/io_tracer_parser.cc +++ b/tools/io_tracer_parser.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include int main() { @@ -16,10 +15,3 @@ int main(int argc, char** argv) { return ROCKSDB_NAMESPACE::io_tracer_parser(argc, argv); } #endif // GFLAGS -#else // ROCKSDB_LITE -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Not supported in lite mode.\n"); - return 1; -} -#endif // ROCKSDB_LITE diff --git a/tools/io_tracer_parser_test.cc b/tools/io_tracer_parser_test.cc index 41be5fa96cd..8e1fb72df39 100644 --- a/tools/io_tracer_parser_test.cc +++ b/tools/io_tracer_parser_test.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include int main() { @@ -181,10 +180,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } #endif // GFLAGS -#else -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "io_tracer_parser_test is not supported in ROCKSDB_LITE\n"); - return 0; -} -#endif // ROCKSDB_LITE diff --git a/tools/io_tracer_parser_tool.cc b/tools/io_tracer_parser_tool.cc index 01b920f3b84..cdaeab044d1 100644 --- a/tools/io_tracer_parser_tool.cc +++ b/tools/io_tracer_parser_tool.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifdef GFLAGS #include "tools/io_tracer_parser_tool.h" @@ -141,4 +140,3 @@ int io_tracer_parser(int argc, char** argv) { } // namespace ROCKSDB_NAMESPACE #endif // GFLAGS -#endif // ROCKSDB_LITE diff --git a/tools/io_tracer_parser_tool.h b/tools/io_tracer_parser_tool.h index 6c22c8f89c4..c79d4c510cf 100644 --- a/tools/io_tracer_parser_tool.h +++ b/tools/io_tracer_parser_tool.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #pragma once #include @@ -37,4 +36,3 @@ class IOTraceRecordParser { int io_tracer_parser(int argc, char** argv); } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/ldb.cc b/tools/ldb.cc index 482383be85f..52533e6b0f6 100644 --- a/tools/ldb.cc +++ b/tools/ldb.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "rocksdb/ldb_tool.h" @@ -12,10 +11,3 @@ int main(int argc, char** argv) { tool.Run(argc, argv); return 0; } -#else -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Not supported in lite mode.\n"); - return 1; -} -#endif // ROCKSDB_LITE diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index ecd2d2977db..b7b0e9909c9 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -4,7 +4,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/ldb_cmd.h" #include @@ -4260,4 +4259,3 @@ void UpdateManifestCommand::DoCommand() { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/ldb_cmd_test.cc b/tools/ldb_cmd_test.cc index 5d83a6cd97c..c5b4115d146 100644 --- a/tools/ldb_cmd_test.cc +++ b/tools/ldb_cmd_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/ldb_cmd.h" #include @@ -1215,12 +1214,3 @@ int main(int argc, char** argv) { RegisterCustomObjects(argc, argv); return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as LDBCommand is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/tools/ldb_tool.cc b/tools/ldb_tool.cc index eadb6a0959f..2fef6660d16 100644 --- a/tools/ldb_tool.cc +++ b/tools/ldb_tool.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "rocksdb/ldb_tool.h" #include "rocksdb/utilities/ldb_cmd.h" @@ -181,4 +180,3 @@ void LDBTool::Run(int argc, char** argv, Options options, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/reduce_levels_test.cc b/tools/reduce_levels_test.cc index c8604bf439b..97f8030b79d 100644 --- a/tools/reduce_levels_test.cc +++ b/tools/reduce_levels_test.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "db/db_impl/db_impl.h" #include "db/version_set.h" @@ -211,12 +210,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as LDBCommand is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/tools/simulated_hybrid_file_system.cc b/tools/simulated_hybrid_file_system.cc index a474417c78a..2b9aa0950fe 100644 --- a/tools/simulated_hybrid_file_system.cc +++ b/tools/simulated_hybrid_file_system.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #include "util/stop_watch.h" -#ifndef ROCKSDB_LITE #include #include @@ -242,4 +241,3 @@ IOStatus SimulatedWritableFile::Sync(const IOOptions& options, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/simulated_hybrid_file_system.h b/tools/simulated_hybrid_file_system.h index 251d89df79d..44b37eadeb1 100644 --- a/tools/simulated_hybrid_file_system.h +++ b/tools/simulated_hybrid_file_system.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -123,4 +122,3 @@ class SimulatedWritableFile : public FSWritableFileWrapper { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/sst_dump.cc b/tools/sst_dump.cc index becf6731666..d68ab90329b 100644 --- a/tools/sst_dump.cc +++ b/tools/sst_dump.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "rocksdb/sst_dump_tool.h" @@ -11,10 +10,3 @@ int main(int argc, char** argv) { ROCKSDB_NAMESPACE::SSTDumpTool tool; return tool.Run(argc, argv); } -#else -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Not supported in lite mode.\n"); - return 1; -} -#endif // ROCKSDB_LITE diff --git a/tools/sst_dump_test.cc b/tools/sst_dump_test.cc index aa1ff810fd2..29d11d4da3a 100644 --- a/tools/sst_dump_test.cc +++ b/tools/sst_dump_test.cc @@ -6,7 +6,6 @@ // Copyright (c) 2012 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include @@ -470,12 +469,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as SSTDumpTool is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE return RUN_ALL_TESTS(); diff --git a/tools/sst_dump_tool.cc b/tools/sst_dump_tool.cc index 0a2c282808a..87577ab8e1c 100644 --- a/tools/sst_dump_tool.cc +++ b/tools/sst_dump_tool.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "rocksdb/sst_dump_tool.h" @@ -581,4 +580,3 @@ int SSTDumpTool::Run(int argc, char const* const* argv, Options options) { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/trace_analyzer.cc b/tools/trace_analyzer.cc index 958078d1c1b..831d351793e 100644 --- a/tools/trace_analyzer.cc +++ b/tools/trace_analyzer.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include int main() { @@ -16,10 +15,3 @@ int main(int argc, char** argv) { return ROCKSDB_NAMESPACE::trace_analyzer_tool(argc, argv); } #endif -#else -#include -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Not supported in lite mode.\n"); - return 1; -} -#endif // ROCKSDB_LITE diff --git a/tools/trace_analyzer_test.cc b/tools/trace_analyzer_test.cc index 7f4035916f1..81dc4f2ccf6 100644 --- a/tools/trace_analyzer_test.cc +++ b/tools/trace_analyzer_test.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include int main() { @@ -879,12 +878,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } #endif // GFLAG -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "Trace_analyzer test is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE return RUN_ALL_TESTS(); diff --git a/tools/trace_analyzer_tool.cc b/tools/trace_analyzer_tool.cc index 25717b5f064..00a4da04616 100644 --- a/tools/trace_analyzer_tool.cc +++ b/tools/trace_analyzer_tool.cc @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #ifdef GFLAGS #ifdef NUMA @@ -1928,4 +1927,3 @@ int trace_analyzer_tool(int argc, char** argv) { } // namespace ROCKSDB_NAMESPACE #endif // Endif of Gflag -#endif // RocksDB LITE diff --git a/tools/trace_analyzer_tool.h b/tools/trace_analyzer_tool.h index 943966d602e..2c3042bdc58 100644 --- a/tools/trace_analyzer_tool.h +++ b/tools/trace_analyzer_tool.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -328,4 +327,3 @@ int trace_analyzer_tool(int argc, char** argv); } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/tools/write_stress.cc b/tools/write_stress.cc index ba5bd3f4f00..5cfec3e8e5b 100644 --- a/tools/write_stress.cc +++ b/tools/write_stress.cc @@ -243,9 +243,6 @@ class WriteStress { } threads_.clear(); -// Skip checking for leaked files in ROCKSDB_LITE since we don't have access to -// function GetLiveFilesMetaData -#ifndef ROCKSDB_LITE // let's see if we leaked some files db_->PauseBackgroundWork(); std::vector metadata; @@ -281,7 +278,6 @@ class WriteStress { } } db_->ContinueBackgroundWork(); -#endif // !ROCKSDB_LITE return 0; } diff --git a/util/autovector.h b/util/autovector.h index f758473b79b..79ee5de5725 100644 --- a/util/autovector.h +++ b/util/autovector.h @@ -16,18 +16,6 @@ namespace ROCKSDB_NAMESPACE { -#ifdef ROCKSDB_LITE -template -class autovector : public std::vector { - using std::vector::vector; - - public: - autovector() { - // Make sure the initial vector has space for kSize elements - std::vector::reserve(kSize); - } -}; -#else // A vector that leverages pre-allocated stack-based array to achieve better // performance for array with small amount of items. // @@ -402,5 +390,4 @@ autovector& autovector::operator=( return *this; } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/util/autovector_test.cc b/util/autovector_test.cc index 8c7c39ce644..b75a0fa2a2f 100644 --- a/util/autovector_test.cc +++ b/util/autovector_test.cc @@ -26,12 +26,7 @@ const unsigned long kSize = 8; namespace { template void AssertAutoVectorOnlyInStack(autovector* vec, bool result) { -#ifndef ROCKSDB_LITE ASSERT_EQ(vec->only_in_stack(), result); -#else - (void)vec; - (void)result; -#endif // !ROCKSDB_LITE } } // namespace @@ -114,9 +109,7 @@ void AssertEqual(const autovector& a, const autovector& b) { ASSERT_EQ(a.size(), b.size()); ASSERT_EQ(a.empty(), b.empty()); -#ifndef ROCKSDB_LITE ASSERT_EQ(a.only_in_stack(), b.only_in_stack()); -#endif // !ROCKSDB_LITE for (size_t i = 0; i < a.size(); ++i) { ASSERT_EQ(a[i], b[i]); } diff --git a/util/build_version.cc.in b/util/build_version.cc.in index c1706dc1fd2..56bc878562a 100644 --- a/util/build_version.cc.in +++ b/util/build_version.cc.in @@ -21,7 +21,6 @@ static const std::string rocksdb_build_date = "rocksdb_build_date:@GIT_DATE@"; static const std::string rocksdb_build_date = "rocksdb_build_date:@BUILD_DATE@"; #endif -#ifndef ROCKSDB_LITE extern "C" { @ROCKSDB_PLUGIN_EXTERNS@ } // extern "C" @@ -29,7 +28,6 @@ extern "C" { std::unordered_map ROCKSDB_NAMESPACE::ObjectRegistry::builtins_ = { @ROCKSDB_PLUGIN_BUILTINS@ }; -#endif //ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { static void AddProperty(std::unordered_map *props, const std::string& name) { diff --git a/util/compaction_job_stats_impl.cc b/util/compaction_job_stats_impl.cc index cfab2a4fefe..587a26f2475 100644 --- a/util/compaction_job_stats_impl.cc +++ b/util/compaction_job_stats_impl.cc @@ -7,7 +7,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE void CompactionJobStats::Reset() { elapsed_micros = 0; @@ -89,12 +88,5 @@ void CompactionJobStats::Add(const CompactionJobStats& stats) { num_single_del_mismatch += stats.num_single_del_mismatch; } -#else - -void CompactionJobStats::Reset() {} - -void CompactionJobStats::Add(const CompactionJobStats& /*stats*/) {} - -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/util/comparator.cc b/util/comparator.cc index f85ed69ee6c..19fd47387ed 100644 --- a/util/comparator.cc +++ b/util/comparator.cc @@ -316,7 +316,6 @@ const Comparator* BytewiseComparatorWithU64Ts() { return &comp_with_u64_ts; } -#ifndef ROCKSDB_LITE static int RegisterBuiltinComparators(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -336,17 +335,14 @@ static int RegisterBuiltinComparators(ObjectLibrary& library, std::string* /* errmsg */) { return BytewiseComparatorWithU64Ts(); }); return 3; } -#endif // ROCKSDB_LITE Status Comparator::CreateFromString(const ConfigOptions& config_options, const std::string& value, const Comparator** result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinComparators(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE std::string id; std::unordered_map opt_map; Status status = Customizable::GetOptionsMap(config_options, *result, value, @@ -368,11 +364,7 @@ Status Comparator::CreateFromString(const ConfigOptions& config_options, } else if (id.empty()) { // We have no Id but have options. Not good return Status::NotSupported("Cannot reset object ", id); } else { -#ifndef ROCKSDB_LITE status = config_options.registry->NewStaticObject(id, result); -#else - status = Status::NotSupported("Cannot load object in LITE mode ", id); -#endif // ROCKSDB_LITE if (!status.ok()) { if (config_options.ignore_unsupported_options && status.IsNotSupported()) { diff --git a/util/duplicate_detector.h b/util/duplicate_detector.h index d778622db81..aa42e950e49 100644 --- a/util/duplicate_detector.h +++ b/util/duplicate_detector.h @@ -56,12 +56,10 @@ class DuplicateDetector { ". WAL must must have been emptied before dropping the column " "family", cf); -#ifndef ROCKSDB_LITE throw std::runtime_error( "Recovering an entry from a dropped column family. " "WAL must must have been flushed before dropping the column " "family"); -#endif return; } auto cmp = h->GetComparator(); diff --git a/util/file_checksum_helper.cc b/util/file_checksum_helper.cc index a7392035245..b35d3abb915 100644 --- a/util/file_checksum_helper.cc +++ b/util/file_checksum_helper.cc @@ -134,7 +134,6 @@ Status GetFileChecksumsFromManifest(Env* src_env, const std::string& abs_path, return retriever.status(); } -#ifndef ROCKSDB_LITE namespace { static int RegisterFileChecksumGenFactories(ObjectLibrary& library, const std::string& /*arg*/) { @@ -149,17 +148,14 @@ static int RegisterFileChecksumGenFactories(ObjectLibrary& library, return 1; } } // namespace -#endif // !ROCKSDB_LITE Status FileChecksumGenFactory::CreateFromString( const ConfigOptions& options, const std::string& value, std::shared_ptr* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterFileChecksumGenFactories(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE if (value == FileChecksumGenCrc32cFactory::kClassName()) { *result = GetFileChecksumGenCrc32cFactory(); return Status::OK(); diff --git a/util/file_reader_writer_test.cc b/util/file_reader_writer_test.cc index e778efc3c54..68776612b90 100644 --- a/util/file_reader_writer_test.cc +++ b/util/file_reader_writer_test.cc @@ -206,11 +206,7 @@ TEST_F(WritableFileWriterTest, IncrementalBuffer) { (attempt < kNumAttempts / 2) ? 512 * 1024 : 700 * 1024; std::string actual; std::unique_ptr wf(new FakeWF(&actual, -#ifndef ROCKSDB_LITE attempt % 2 == 1, -#else - false, -#endif no_flush)); std::unique_ptr writer(new WritableFileWriter( std::move(wf), "" /* don't care */, env_options)); @@ -421,7 +417,6 @@ TEST_F(DBWritableFileWriterTest, AppendWithChecksumRateLimiter) { Destroy(options); } -#ifndef ROCKSDB_LITE TEST_F(WritableFileWriterTest, AppendStatusReturn) { class FakeWF : public FSWritableFile { public: @@ -477,7 +472,6 @@ TEST_F(WritableFileWriterTest, AppendStatusReturn) { fwf->SetIOError(true); ASSERT_NOK(writer->Append(std::string(2 * kMb, 'b'))); } -#endif class ReadaheadRandomAccessFileTest : public testing::Test, @@ -792,7 +786,6 @@ TEST(LineFileReaderTest, LineFileReaderTest) { } } -#ifndef ROCKSDB_LITE class IOErrorEventListener : public EventListener { public: IOErrorEventListener() { notify_error_.store(0); } @@ -908,7 +901,6 @@ TEST_F(DBWritableFileWriterTest, IOErrorNotification) { ASSERT_EQ(listener->NotifyErrorCount(), 2); fwf->CheckCounters(1, 1); } -#endif // ROCKSDB_LITE class WritableFileWriterIOPriorityTest : public testing::Test { protected: diff --git a/util/filter_bench.cc b/util/filter_bench.cc index 93186cd0841..13bd40300f1 100644 --- a/util/filter_bench.cc +++ b/util/filter_bench.cc @@ -3,10 +3,10 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#if !defined(GFLAGS) || defined(ROCKSDB_LITE) +#if !defined(GFLAGS) #include int main() { - fprintf(stderr, "filter_bench requires gflags and !ROCKSDB_LITE\n"); + fprintf(stderr, "filter_bench requires gflags\n"); return 1; } #else @@ -837,4 +837,4 @@ int main(int argc, char **argv) { return 0; } -#endif // !defined(GFLAGS) || defined(ROCKSDB_LITE) +#endif // !defined(GFLAGS) diff --git a/util/slice.cc b/util/slice.cc index 1fa21afcb2d..22dd7ee6bb1 100644 --- a/util/slice.cc +++ b/util/slice.cc @@ -156,7 +156,6 @@ const SliceTransform* NewCappedPrefixTransform(size_t cap_len) { const SliceTransform* NewNoopTransform() { return new NoopTransform; } -#ifndef ROCKSDB_LITE static int RegisterBuiltinSliceTransform(ObjectLibrary& library, const std::string& /*arg*/) { // For the builtin transforms, the format is typically @@ -212,17 +211,14 @@ static int RegisterBuiltinSliceTransform(ObjectLibrary& library, size_t num_types; return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE Status SliceTransform::CreateFromString( const ConfigOptions& config_options, const std::string& value, std::shared_ptr* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinSliceTransform(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE std::string id; std::unordered_map opt_map; Status status = Customizable::GetOptionsMap(config_options, result->get(), @@ -232,39 +228,7 @@ Status SliceTransform::CreateFromString( } else if (id.empty() && opt_map.empty()) { result->reset(); } else { -#ifndef ROCKSDB_LITE status = config_options.registry->NewSharedObject(id, result); -#else - auto Matches = [](const std::string& input, size_t size, - const char* pattern, char sep) { - auto plen = strlen(pattern); - return (size > plen + 2 && input[plen] == sep && - StartsWith(input, pattern)); - }; - - auto size = id.size(); - if (id == NoopTransform::kClassName()) { - result->reset(NewNoopTransform()); - } else if (Matches(id, size, FixedPrefixTransform::kNickName(), ':')) { - auto fixed = strlen(FixedPrefixTransform::kNickName()); - auto len = ParseSizeT(id.substr(fixed + 1)); - result->reset(NewFixedPrefixTransform(len)); - } else if (Matches(id, size, CappedPrefixTransform::kNickName(), ':')) { - auto capped = strlen(CappedPrefixTransform::kNickName()); - auto len = ParseSizeT(id.substr(capped + 1)); - result->reset(NewCappedPrefixTransform(len)); - } else if (Matches(id, size, CappedPrefixTransform::kClassName(), '.')) { - auto capped = strlen(CappedPrefixTransform::kClassName()); - auto len = ParseSizeT(id.substr(capped + 1)); - result->reset(NewCappedPrefixTransform(len)); - } else if (Matches(id, size, FixedPrefixTransform::kClassName(), '.')) { - auto fixed = strlen(FixedPrefixTransform::kClassName()); - auto len = ParseSizeT(id.substr(fixed + 1)); - result->reset(NewFixedPrefixTransform(len)); - } else { - status = Status::NotSupported("Cannot load object in LITE mode ", id); - } -#endif // ROCKSDB_LITE if (config_options.ignore_unsupported_options && status.IsNotSupported()) { return Status::OK(); } else if (status.ok()) { @@ -277,13 +241,11 @@ Status SliceTransform::CreateFromString( } std::string SliceTransform::AsString() const { -#ifndef ROCKSDB_LITE if (HasRegisteredOptions()) { ConfigOptions opts; opts.delimiter = ";"; return ToString(opts); } -#endif // ROCKSDB_LITE return GetId(); } diff --git a/util/string_util.cc b/util/string_util.cc index 324482a4cd7..821ccba07f4 100644 --- a/util/string_util.cc +++ b/util/string_util.cc @@ -286,7 +286,6 @@ bool StartsWith(const std::string& string, const std::string& pattern) { return string.compare(0, pattern.size(), pattern) == 0; } -#ifndef ROCKSDB_LITE bool ParseBoolean(const std::string& type, const std::string& value) { if (value == "true" || value == "1") { @@ -325,7 +324,6 @@ int32_t ParseInt32(const std::string& value) { } } -#endif uint64_t ParseUint64(const std::string& value) { size_t endchar; diff --git a/util/string_util.h b/util/string_util.h index 11178fd1d7b..0b15181f5df 100644 --- a/util/string_util.h +++ b/util/string_util.h @@ -144,7 +144,6 @@ bool EndsWith(const std::string& string, const std::string& pattern); // Returns true if "string" starts with "pattern" bool StartsWith(const std::string& string, const std::string& pattern); -#ifndef ROCKSDB_LITE bool ParseBoolean(const std::string& type, const std::string& value); uint8_t ParseUint8(const std::string& value); @@ -152,7 +151,6 @@ uint8_t ParseUint8(const std::string& value); uint32_t ParseUint32(const std::string& value); int32_t ParseInt32(const std::string& value); -#endif uint64_t ParseUint64(const std::string& value); diff --git a/util/thread_local_test.cc b/util/thread_local_test.cc index 25ef5c0eecc..3d12fe83a7e 100644 --- a/util/thread_local_test.cc +++ b/util/thread_local_test.cc @@ -559,18 +559,14 @@ TEST_F(ThreadLocalTest, DISABLED_MainThreadDiesFirst) { // Triggers the initialization of singletons. Env::Default(); -#ifndef ROCKSDB_LITE try { -#endif // ROCKSDB_LITE ROCKSDB_NAMESPACE::port::Thread th(&AccessThreadLocal, nullptr); th.detach(); TEST_SYNC_POINT("MainThreadDiesFirst:End"); -#ifndef ROCKSDB_LITE } catch (const std::system_error& ex) { std::cerr << "Start thread: " << ex.code() << std::endl; FAIL(); } -#endif // ROCKSDB_LITE } } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/backup/backup_engine.cc b/utilities/backup/backup_engine.cc index d8f7d928a08..98f5d9d0d8e 100644 --- a/utilities/backup/backup_engine.cc +++ b/utilities/backup/backup_engine.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include #include @@ -3354,4 +3353,3 @@ void TEST_SetDefaultRateLimitersClock( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/backup/backup_engine_impl.h b/utilities/backup/backup_engine_impl.h index 398f47f2725..a764b34d9b1 100644 --- a/utilities/backup/backup_engine_impl.h +++ b/utilities/backup/backup_engine_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/backup_engine.h" @@ -33,4 +32,3 @@ void TEST_SetDefaultRateLimitersClock( const std::shared_ptr& backup_rate_limiter_clock = nullptr, const std::shared_ptr& restore_rate_limiter_clock = nullptr); } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/backup/backup_engine_test.cc b/utilities/backup/backup_engine_test.cc index d780a1b2b26..0c4a6a3c5f5 100644 --- a/utilities/backup/backup_engine_test.cc +++ b/utilities/backup/backup_engine_test.cc @@ -7,7 +7,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#if !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#if !defined(OS_WIN) #include "rocksdb/utilities/backup_engine.h" @@ -4407,8 +4407,8 @@ int main(int argc, char** argv) { #include int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as BackupEngine is not supported in ROCKSDB_LITE\n"); + fprintf(stderr, "SKIPPED as BackupEngine is not supported in Windows\n"); return 0; } -#endif // !defined(ROCKSDB_LITE) && !defined(OS_WIN) +#endif // !defined(OS_WIN) diff --git a/utilities/blob_db/blob_compaction_filter.cc b/utilities/blob_db/blob_compaction_filter.cc index 86907e979b9..ddaa98c7d32 100644 --- a/utilities/blob_db/blob_compaction_filter.cc +++ b/utilities/blob_db/blob_compaction_filter.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/blob_db/blob_compaction_filter.h" @@ -487,4 +486,3 @@ BlobIndexCompactionFilterFactoryGC::CreateCompactionFilter( } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_compaction_filter.h b/utilities/blob_db/blob_compaction_filter.h index 1493cfc1a53..e7858b08606 100644 --- a/utilities/blob_db/blob_compaction_filter.h +++ b/utilities/blob_db/blob_compaction_filter.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -201,4 +200,3 @@ class BlobIndexCompactionFilterFactoryGC } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db.cc b/utilities/blob_db/blob_db.cc index cbd02e68e93..b6fe0390364 100644 --- a/utilities/blob_db/blob_db.cc +++ b/utilities/blob_db/blob_db.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "utilities/blob_db/blob_db.h" @@ -111,4 +110,3 @@ void BlobDBOptions::Dump(Logger* log) const { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/blob_db/blob_db.h b/utilities/blob_db/blob_db.h index e9d92486f9b..e2f0b7bdbdd 100644 --- a/utilities/blob_db/blob_db.h +++ b/utilities/blob_db/blob_db.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -263,4 +262,3 @@ Status DestroyBlobDB(const std::string& dbname, const Options& options, } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db_gc_stats.h b/utilities/blob_db/blob_db_gc_stats.h index fea6b003289..12c11af8549 100644 --- a/utilities/blob_db/blob_db_gc_stats.h +++ b/utilities/blob_db/blob_db_gc_stats.h @@ -9,7 +9,6 @@ #include "rocksdb/rocksdb_namespace.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { @@ -53,4 +52,3 @@ class BlobDBGarbageCollectionStats { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db_impl.cc b/utilities/blob_db/blob_db_impl.cc index 87e294c5c09..3a5e337b677 100644 --- a/utilities/blob_db/blob_db_impl.cc +++ b/utilities/blob_db/blob_db_impl.cc @@ -3,7 +3,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/blob_db/blob_db_impl.h" @@ -2174,4 +2173,3 @@ void BlobDBImpl::TEST_ProcessCompactionJobInfo(const CompactionJobInfo& info) { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db_impl.h b/utilities/blob_db/blob_db_impl.h index 0b4dbf5e53b..de888c0683d 100644 --- a/utilities/blob_db/blob_db_impl.h +++ b/utilities/blob_db/blob_db_impl.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -500,4 +499,3 @@ class BlobDBImpl : public BlobDB { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db_impl_filesnapshot.cc b/utilities/blob_db/blob_db_impl_filesnapshot.cc index 87e3f33cc65..da2d02d07a4 100644 --- a/utilities/blob_db/blob_db_impl_filesnapshot.cc +++ b/utilities/blob_db/blob_db_impl_filesnapshot.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "file/filename.h" #include "logging/logging.h" @@ -110,4 +109,3 @@ void BlobDBImpl::GetLiveFilesMetaData(std::vector* metadata) { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db_iterator.h b/utilities/blob_db/blob_db_iterator.h index fd2b2f8f527..4898ddfd769 100644 --- a/utilities/blob_db/blob_db_iterator.h +++ b/utilities/blob_db/blob_db_iterator.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include "db/arena_wrapped_db_iter.h" #include "rocksdb/iterator.h" @@ -147,4 +146,3 @@ class BlobDBIterator : public Iterator { }; } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db_listener.h b/utilities/blob_db/blob_db_listener.h index d17d2985356..16aed334041 100644 --- a/utilities/blob_db/blob_db_listener.h +++ b/utilities/blob_db/blob_db_listener.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -68,4 +67,3 @@ class BlobDBListenerGC : public BlobDBListener { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/blob_db/blob_db_test.cc b/utilities/blob_db/blob_db_test.cc index e392962b2f8..3f25c22a294 100644 --- a/utilities/blob_db/blob_db_test.cc +++ b/utilities/blob_db/blob_db_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/blob_db/blob_db.h" @@ -2396,12 +2395,3 @@ int main(int argc, char **argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as BlobDB is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/utilities/blob_db/blob_dump_tool.cc b/utilities/blob_db/blob_dump_tool.cc index 1e063299015..9b0fa314d47 100644 --- a/utilities/blob_db/blob_dump_tool.cc +++ b/utilities/blob_db/blob_dump_tool.cc @@ -2,7 +2,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/blob_db/blob_dump_tool.h" @@ -279,4 +278,3 @@ std::string BlobDumpTool::GetString(std::pair p) { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_dump_tool.h b/utilities/blob_db/blob_dump_tool.h index bece564e1cc..12cd1bf4221 100644 --- a/utilities/blob_db/blob_dump_tool.h +++ b/utilities/blob_db/blob_dump_tool.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -55,4 +54,3 @@ class BlobDumpTool { } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_file.cc b/utilities/blob_db/blob_file.cc index c68e557c676..cad89f2e496 100644 --- a/utilities/blob_db/blob_file.cc +++ b/utilities/blob_db/blob_file.cc @@ -3,7 +3,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/blob_db/blob_file.h" #include @@ -315,4 +314,3 @@ Status BlobFile::ReadMetadata(const std::shared_ptr& fs, } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/blob_db/blob_file.h b/utilities/blob_db/blob_file.h index 6f3f2bea7c3..8651c6b6728 100644 --- a/utilities/blob_db/blob_file.h +++ b/utilities/blob_db/blob_file.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -243,4 +242,3 @@ class BlobFile { }; } // namespace blob_db } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/cache_dump_load.cc b/utilities/cache_dump_load.cc index 9a7c7679875..bbe02a93401 100644 --- a/utilities/cache_dump_load.cc +++ b/utilities/cache_dump_load.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/cache_dump_load.h" @@ -66,4 +65,3 @@ Status NewDefaultCacheDumpedLoader( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/cache_dump_load_impl.cc b/utilities/cache_dump_load_impl.cc index b5e21291b34..52f2a4df7d9 100644 --- a/utilities/cache_dump_load_impl.cc +++ b/utilities/cache_dump_load_impl.cc @@ -5,7 +5,6 @@ #include "cache/cache_key.h" #include "table/block_based/block_based_table_reader.h" -#ifndef ROCKSDB_LITE #include "cache/cache_entry_roles.h" #include "file/writable_file_writer.h" @@ -368,4 +367,3 @@ IOStatus CacheDumpedLoaderImpl::ReadCacheBlock(std::string* data, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/cache_dump_load_impl.h b/utilities/cache_dump_load_impl.h index ad637b00dd7..9811ff2d912 100644 --- a/utilities/cache_dump_load_impl.h +++ b/utilities/cache_dump_load_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -355,4 +354,3 @@ class CacheDumperHelper { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/cassandra/cassandra_compaction_filter.cc b/utilities/cassandra/cassandra_compaction_filter.cc index 4e48d63aabe..b7da2ba0cbc 100644 --- a/utilities/cassandra/cassandra_compaction_filter.cc +++ b/utilities/cassandra/cassandra_compaction_filter.cc @@ -17,7 +17,6 @@ namespace ROCKSDB_NAMESPACE { namespace cassandra { static std::unordered_map cassandra_filter_type_info = { -#ifndef ROCKSDB_LITE {"purge_ttl_on_expiration", {offsetof(struct CassandraOptions, purge_ttl_on_expiration), OptionType::kBoolean, OptionVerificationType::kNormal, @@ -26,7 +25,6 @@ static std::unordered_map {offsetof(struct CassandraOptions, gc_grace_period_in_seconds), OptionType::kUInt32T, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; CassandraCompactionFilter::CassandraCompactionFilter( @@ -77,7 +75,6 @@ CassandraCompactionFilterFactory::CreateCompactionFilter( return result; } -#ifndef ROCKSDB_LITE int RegisterCassandraObjects(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -105,6 +102,5 @@ int RegisterCassandraObjects(ObjectLibrary& library, size_t num_types; return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE } // namespace cassandra } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/cassandra/cassandra_functional_test.cc b/utilities/cassandra/cassandra_functional_test.cc index c5be836e8f5..e3266a0dc11 100644 --- a/utilities/cassandra/cassandra_functional_test.cc +++ b/utilities/cassandra/cassandra_functional_test.cc @@ -343,7 +343,6 @@ TEST_F(CassandraFunctionalTest, CompactionShouldRemoveTombstoneFromPut) { ASSERT_FALSE(std::get<0>(store.Get("k1"))); } -#ifndef ROCKSDB_LITE TEST_F(CassandraFunctionalTest, LoadMergeOperator) { ConfigOptions config_options; std::shared_ptr mo; @@ -434,7 +433,6 @@ TEST_F(CassandraFunctionalTest, LoadCompactionFilterFactory) { ASSERT_EQ(opts->gc_grace_period_in_seconds, 42); ASSERT_TRUE(opts->purge_ttl_on_expiration); } -#endif // ROCKSDB_LITE } // namespace cassandra } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/cassandra/cassandra_options.h b/utilities/cassandra/cassandra_options.h index efa73a30836..e0527aada66 100644 --- a/utilities/cassandra/cassandra_options.h +++ b/utilities/cassandra/cassandra_options.h @@ -34,10 +34,8 @@ struct CassandraOptions { // data back. bool purge_ttl_on_expiration; }; -#ifndef ROCKSDB_LITE extern "C" { int RegisterCassandraObjects(ObjectLibrary& library, const std::string& arg); } // extern "C" -#endif // ROCKSDB_LITE } // namespace cassandra } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/cassandra/merge_operator.cc b/utilities/cassandra/merge_operator.cc index bde5dcbaddb..366d8fa4435 100644 --- a/utilities/cassandra/merge_operator.cc +++ b/utilities/cassandra/merge_operator.cc @@ -19,7 +19,6 @@ namespace ROCKSDB_NAMESPACE { namespace cassandra { static std::unordered_map merge_operator_options_info = { -#ifndef ROCKSDB_LITE {"gc_grace_period_in_seconds", {offsetof(struct CassandraOptions, gc_grace_period_in_seconds), OptionType::kUInt32T, OptionVerificationType::kNormal, @@ -27,7 +26,6 @@ static std::unordered_map {"operands_limit", {offsetof(struct CassandraOptions, operands_limit), OptionType::kSizeT, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; CassandraValueMergeOperator::CassandraValueMergeOperator( diff --git a/utilities/checkpoint/checkpoint_impl.cc b/utilities/checkpoint/checkpoint_impl.cc index cdea325cd71..6c1a7381931 100644 --- a/utilities/checkpoint/checkpoint_impl.cc +++ b/utilities/checkpoint/checkpoint_impl.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ROCKSDB_LITE #include "utilities/checkpoint/checkpoint_impl.h" @@ -467,4 +466,3 @@ Status CheckpointImpl::ExportFilesInMetaData( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/checkpoint/checkpoint_impl.h b/utilities/checkpoint/checkpoint_impl.h index 2947330ccef..3cb9a6477f0 100644 --- a/utilities/checkpoint/checkpoint_impl.h +++ b/utilities/checkpoint/checkpoint_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -63,4 +62,3 @@ class CheckpointImpl : public Checkpoint { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/checkpoint/checkpoint_test.cc b/utilities/checkpoint/checkpoint_test.cc index 3da753d5f3b..5020da45236 100644 --- a/utilities/checkpoint/checkpoint_test.cc +++ b/utilities/checkpoint/checkpoint_test.cc @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. // Syncpoint prevents us building and running tests in release -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/checkpoint.h" #ifndef OS_WIN @@ -963,12 +962,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as Checkpoint is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/utilities/compaction_filters.cc b/utilities/compaction_filters.cc index 8763901c3dc..cb14c48d9ad 100644 --- a/utilities/compaction_filters.cc +++ b/utilities/compaction_filters.cc @@ -13,7 +13,6 @@ #include "utilities/compaction_filters/remove_emptyvalue_compactionfilter.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE static int RegisterBuiltinCompactionFilters(ObjectLibrary& library, const std::string& /*arg*/) { library.AddFactory( @@ -25,16 +24,13 @@ static int RegisterBuiltinCompactionFilters(ObjectLibrary& library, }); return 1; } -#endif // ROCKSDB_LITE Status CompactionFilter::CreateFromString(const ConfigOptions& config_options, const std::string& value, const CompactionFilter** result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinCompactionFilters(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE CompactionFilter* filter = const_cast(*result); Status status = LoadStaticObject(config_options, value, nullptr, &filter); diff --git a/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc b/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc index b788dbf9b06..c61ce022042 100644 --- a/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc +++ b/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/compaction_filters/remove_emptyvalue_compactionfilter.h" @@ -23,4 +22,3 @@ bool RemoveEmptyValueCompactionFilter::Filter(int /*level*/, } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h b/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h index 864ad15ffaf..2a56bd6c2ec 100644 --- a/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h +++ b/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #pragma once @@ -25,4 +24,3 @@ class RemoveEmptyValueCompactionFilter : public CompactionFilter { }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/debug.cc b/utilities/debug.cc index f2c3bb51376..911bc510a6a 100644 --- a/utilities/debug.cc +++ b/utilities/debug.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/debug.h" @@ -117,4 +116,3 @@ Status GetAllKeyVersions(DB* db, ColumnFamilyHandle* cfh, Slice begin_key, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/env_mirror.cc b/utilities/env_mirror.cc index 3ea323b4297..0802d7c708f 100644 --- a/utilities/env_mirror.cc +++ b/utilities/env_mirror.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/env_mirror.h" @@ -272,4 +271,3 @@ Status EnvMirror::ReuseWritableFile(const std::string& fname, } } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/env_mirror_test.cc b/utilities/env_mirror_test.cc index c372de1da5e..ad4cc936686 100644 --- a/utilities/env_mirror_test.cc +++ b/utilities/env_mirror_test.cc @@ -4,7 +4,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/env_mirror.h" @@ -215,12 +214,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int argc, char** argv) { - fprintf(stderr, "SKIPPED as EnvMirror is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/utilities/env_timed.cc b/utilities/env_timed.cc index 1eb7231463f..01fdfccaf32 100644 --- a/utilities/env_timed.cc +++ b/utilities/env_timed.cc @@ -12,7 +12,6 @@ namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE TimedFileSystem::TimedFileSystem(const std::shared_ptr& base) : FileSystemWrapper(base) {} IOStatus TimedFileSystem::NewSequentialFile( @@ -178,10 +177,5 @@ Env* NewTimedEnv(Env* base_env) { return new CompositeEnvWrapper(base_env, timed_fs); } -#else // ROCKSDB_LITE - -Env* NewTimedEnv(Env* /*base_env*/) { return nullptr; } - -#endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/env_timed.h b/utilities/env_timed.h index 2d34fd59012..6c6ac89fb43 100644 --- a/utilities/env_timed.h +++ b/utilities/env_timed.h @@ -7,7 +7,6 @@ #pragma once #include "rocksdb/file_system.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE class TimedFileSystem : public FileSystemWrapper { public: explicit TimedFileSystem(const std::shared_ptr& base); @@ -93,5 +92,4 @@ class TimedFileSystem : public FileSystemWrapper { IODebugContext* dbg) override; }; -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/env_timed_test.cc b/utilities/env_timed_test.cc index 6e392579d2b..3099fb74c7b 100644 --- a/utilities/env_timed_test.cc +++ b/utilities/env_timed_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/env.h" #include "rocksdb/perf_context.h" @@ -33,12 +32,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else // ROCKSDB_LITE -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as TimedEnv is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/memory/memory_test.cc b/utilities/memory/memory_test.cc index 2838a1c36db..8255a6cad79 100644 --- a/utilities/memory/memory_test.cc +++ b/utilities/memory/memory_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "db/db_impl/db_impl.h" #include "rocksdb/cache.h" @@ -268,11 +267,3 @@ int main(int argc, char** argv) { #endif } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - printf("Skipped in RocksDBLite as utilities are not supported.\n"); - return 0; -} -#endif // !ROCKSDB_LITE diff --git a/utilities/memory/memory_util.cc b/utilities/memory/memory_util.cc index 13c81aec4a9..62042192f91 100644 --- a/utilities/memory/memory_util.cc +++ b/utilities/memory/memory_util.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/memory_util.h" @@ -49,4 +48,3 @@ Status MemoryUtil::GetApproximateMemoryUsageByType( return Status::OK(); } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/merge_operators.cc b/utilities/merge_operators.cc index c97e9ce2514..16e361ed4fc 100644 --- a/utilities/merge_operators.cc +++ b/utilities/merge_operators.cc @@ -30,28 +30,12 @@ static bool LoadMergeOperator(const std::string& id, *result = MergeOperators::CreateUInt64AddOperator(); } else if (id == "max" || id == "MaxOperator") { *result = MergeOperators::CreateMaxOperator(); -#ifdef ROCKSDB_LITE - // The remainder of the classes are handled by the ObjectRegistry in - // non-LITE mode - } else if (id == StringAppendOperator::kNickName() || - id == StringAppendOperator::kClassName()) { - *result = MergeOperators::CreateStringAppendOperator(); - } else if (id == StringAppendTESTOperator::kNickName() || - id == StringAppendTESTOperator::kClassName()) { - *result = MergeOperators::CreateStringAppendTESTOperator(); - } else if (id == BytesXOROperator::kNickName() || - id == BytesXOROperator::kClassName()) { - *result = MergeOperators::CreateBytesXOROperator(); - } else if (id == SortList::kNickName() || id == SortList::kClassName()) { - *result = MergeOperators::CreateSortOperator(); -#endif // ROCKSDB_LITE } else { success = false; } return success; } -#ifndef ROCKSDB_LITE static int RegisterBuiltinMergeOperators(ObjectLibrary& library, const std::string& /*arg*/) { size_t num_types; @@ -90,17 +74,14 @@ static int RegisterBuiltinMergeOperators(ObjectLibrary& library, return static_cast(library.GetFactoryCount(&num_types)); } -#endif // ROCKSDB_LITE Status MergeOperator::CreateFromString(const ConfigOptions& config_options, const std::string& value, std::shared_ptr* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterBuiltinMergeOperators(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE return LoadSharedObject(config_options, value, LoadMergeOperator, result); } diff --git a/utilities/merge_operators/string_append/stringappend.cc b/utilities/merge_operators/string_append/stringappend.cc index 5092cabcb45..720dc7200a4 100644 --- a/utilities/merge_operators/string_append/stringappend.cc +++ b/utilities/merge_operators/string_append/stringappend.cc @@ -19,11 +19,9 @@ namespace ROCKSDB_NAMESPACE { namespace { static std::unordered_map stringappend_merge_type_info = { -#ifndef ROCKSDB_LITE {"delimiter", {0, OptionType::kString, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; } // namespace // Constructor: also specify the delimiter character. diff --git a/utilities/merge_operators/string_append/stringappend2.cc b/utilities/merge_operators/string_append/stringappend2.cc index 36cb9ee34ea..8b6fe9020ad 100644 --- a/utilities/merge_operators/string_append/stringappend2.cc +++ b/utilities/merge_operators/string_append/stringappend2.cc @@ -19,11 +19,9 @@ namespace ROCKSDB_NAMESPACE { namespace { static std::unordered_map stringappend2_merge_type_info = { -#ifndef ROCKSDB_LITE {"delimiter", {0, OptionType::kString, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, -#endif // ROCKSDB_LITE }; } // namespace diff --git a/utilities/merge_operators/string_append/stringappend_test.cc b/utilities/merge_operators/string_append/stringappend_test.cc index 22b6144af65..0bf09af8a0c 100644 --- a/utilities/merge_operators/string_append/stringappend_test.cc +++ b/utilities/merge_operators/string_append/stringappend_test.cc @@ -49,7 +49,6 @@ std::shared_ptr OpenNormalDb(const std::string& delim) { return std::shared_ptr(db); } -#ifndef ROCKSDB_LITE // TtlDb is not supported in Lite // Open a TtlDB with a non-associative StringAppendTESTOperator std::shared_ptr OpenTtlDb(const std::string& delim) { DBWithTTL* db; @@ -65,7 +64,6 @@ std::shared_ptr OpenTtlDb(const std::string& delim) { EXPECT_OK(DBWithTTL::Open(options, kDbName, &db, 123456)); return std::shared_ptr(db); } -#endif // !ROCKSDB_LITE } // namespace /// StringLists represents a set of string-lists, each with a key-index. @@ -130,14 +128,12 @@ class StringAppendOperatorTest : public testing::Test, } void SetUp() override { -#ifndef ROCKSDB_LITE // TtlDb is not supported in Lite bool if_use_ttl = GetParam(); if (if_use_ttl) { fprintf(stderr, "Running tests with ttl db and generic operator.\n"); StringAppendOperatorTest::SetOpenDbFunction(&OpenTtlDb); return; } -#endif // !ROCKSDB_LITE fprintf(stderr, "Running tests with regular db and operator.\n"); StringAppendOperatorTest::SetOpenDbFunction(&OpenNormalDb); } diff --git a/utilities/object_registry.cc b/utilities/object_registry.cc index 18834783d84..786f2ee2e43 100644 --- a/utilities/object_registry.cc +++ b/utilities/object_registry.cc @@ -14,7 +14,6 @@ #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE namespace { bool MatchesInteger(const std::string &target, size_t start, size_t pos) { // If it is numeric, everything up to the match must be a number @@ -379,5 +378,4 @@ int ObjectRegistry::RegisterPlugin(const std::string &name, } } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE diff --git a/utilities/object_registry_test.cc b/utilities/object_registry_test.cc index 90cd155ee08..4042bc9b90e 100644 --- a/utilities/object_registry_test.cc +++ b/utilities/object_registry_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/object_registry.h" @@ -861,12 +860,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else // ROCKSDB_LITE -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as ObjRegistry is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/option_change_migration/option_change_migration.cc b/utilities/option_change_migration/option_change_migration.cc index e93d2152dc1..ea3cf685712 100644 --- a/utilities/option_change_migration/option_change_migration.cc +++ b/utilities/option_change_migration/option_change_migration.cc @@ -5,7 +5,6 @@ #include "rocksdb/utilities/option_change_migration.h" -#ifndef ROCKSDB_LITE #include "rocksdb/db.h" namespace ROCKSDB_NAMESPACE { @@ -175,12 +174,3 @@ Status OptionChangeMigration(std::string dbname, const Options& old_opts, } } } // namespace ROCKSDB_NAMESPACE -#else -namespace ROCKSDB_NAMESPACE { -Status OptionChangeMigration(std::string /*dbname*/, - const Options& /*old_opts*/, - const Options& /*new_opts*/) { - return Status::NotSupported(); -} -} // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/option_change_migration/option_change_migration_test.cc b/utilities/option_change_migration/option_change_migration_test.cc index 71af45db1c5..e1f9edc896f 100644 --- a/utilities/option_change_migration/option_change_migration_test.cc +++ b/utilities/option_change_migration/option_change_migration_test.cc @@ -49,7 +49,6 @@ class DBOptionChangeMigrationTests uint64_t fifo_max_table_files_size_; }; -#ifndef ROCKSDB_LITE TEST_P(DBOptionChangeMigrationTests, Migrate1) { Options old_options = CurrentOptions(); old_options.compaction_style = @@ -540,7 +539,6 @@ TEST_F(DBOptionChangeMigrationTest, CompactedSrcToUniversal) { } } -#endif // ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/utilities/options/options_util.cc b/utilities/options/options_util.cc index 60a86603cc3..394bf431f46 100644 --- a/utilities/options/options_util.cc +++ b/utilities/options/options_util.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/options_util.h" @@ -116,4 +115,3 @@ Status CheckOptionsCompatibility( } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/options/options_util_test.cc b/utilities/options/options_util_test.cc index 1e02461bf29..4a7d197504c 100644 --- a/utilities/options/options_util_test.cc +++ b/utilities/options/options_util_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/options_util.h" @@ -766,11 +765,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - printf("Skipped in RocksDBLite as utilities are not supported.\n"); - return 0; -} -#endif // !ROCKSDB_LITE diff --git a/utilities/persistent_cache/block_cache_tier.cc b/utilities/persistent_cache/block_cache_tier.cc index 8ad9bb1b166..3118fc2df68 100644 --- a/utilities/persistent_cache/block_cache_tier.cc +++ b/utilities/persistent_cache/block_cache_tier.cc @@ -2,7 +2,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/persistent_cache/block_cache_tier.h" @@ -419,4 +418,3 @@ Status NewPersistentCache(Env* const env, const std::string& path, } // namespace ROCKSDB_NAMESPACE -#endif // ifndef ROCKSDB_LITE diff --git a/utilities/persistent_cache/block_cache_tier.h b/utilities/persistent_cache/block_cache_tier.h index 1aac287cc0e..caabbef94eb 100644 --- a/utilities/persistent_cache/block_cache_tier.h +++ b/utilities/persistent_cache/block_cache_tier.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #ifndef OS_WIN #include @@ -153,4 +152,3 @@ class BlockCacheTier : public PersistentCacheTier { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/block_cache_tier_file.cc b/utilities/persistent_cache/block_cache_tier_file.cc index f4f8517abe3..9a667c1fdce 100644 --- a/utilities/persistent_cache/block_cache_tier_file.cc +++ b/utilities/persistent_cache/block_cache_tier_file.cc @@ -2,7 +2,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/persistent_cache/block_cache_tier_file.h" @@ -607,4 +606,3 @@ void ThreadedWriter::DispatchIO(const IO& io) { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/block_cache_tier_file.h b/utilities/persistent_cache/block_cache_tier_file.h index 1d265ab74fb..127f5a8676a 100644 --- a/utilities/persistent_cache/block_cache_tier_file.h +++ b/utilities/persistent_cache/block_cache_tier_file.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -290,4 +289,3 @@ class ThreadedWriter : public Writer { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/block_cache_tier_metadata.cc b/utilities/persistent_cache/block_cache_tier_metadata.cc index d73b5d0b48a..182df6ca65a 100644 --- a/utilities/persistent_cache/block_cache_tier_metadata.cc +++ b/utilities/persistent_cache/block_cache_tier_metadata.cc @@ -2,7 +2,6 @@ // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/persistent_cache/block_cache_tier_metadata.h" @@ -83,4 +82,3 @@ void BlockCacheTierMetadata::RemoveAllKeys(BlockCacheFile* f) { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/block_cache_tier_metadata.h b/utilities/persistent_cache/block_cache_tier_metadata.h index 2fcd501056d..15eb0be3d96 100644 --- a/utilities/persistent_cache/block_cache_tier_metadata.h +++ b/utilities/persistent_cache/block_cache_tier_metadata.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -121,4 +120,3 @@ class BlockCacheTierMetadata { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/hash_table.h b/utilities/persistent_cache/hash_table.h index b00b294ce9d..13b2ec7d66f 100644 --- a/utilities/persistent_cache/hash_table.h +++ b/utilities/persistent_cache/hash_table.h @@ -5,7 +5,6 @@ // #pragma once -#ifndef ROCKSDB_LITE #include @@ -236,4 +235,3 @@ class HashTable { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/hash_table_bench.cc b/utilities/persistent_cache/hash_table_bench.cc index 74d7e2edfbf..bf4406bb355 100644 --- a/utilities/persistent_cache/hash_table_bench.cc +++ b/utilities/persistent_cache/hash_table_bench.cc @@ -4,7 +4,7 @@ // (found in the LICENSE.Apache file in the root directory). // -#if !defined(OS_WIN) && !defined(ROCKSDB_LITE) +#if !defined(OS_WIN) #ifndef GFLAGS #include diff --git a/utilities/persistent_cache/hash_table_evictable.h b/utilities/persistent_cache/hash_table_evictable.h index e10939b2f7d..daf4bec1aef 100644 --- a/utilities/persistent_cache/hash_table_evictable.h +++ b/utilities/persistent_cache/hash_table_evictable.h @@ -5,7 +5,6 @@ // #pragma once -#ifndef ROCKSDB_LITE #include @@ -165,4 +164,3 @@ class EvictableHashTable : private HashTable { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/hash_table_test.cc b/utilities/persistent_cache/hash_table_test.cc index 2f6387f5fb3..faae2cf2142 100644 --- a/utilities/persistent_cache/hash_table_test.cc +++ b/utilities/persistent_cache/hash_table_test.cc @@ -17,7 +17,6 @@ #include "util/random.h" #include "utilities/persistent_cache/hash_table_evictable.h" -#ifndef ROCKSDB_LITE namespace ROCKSDB_NAMESPACE { @@ -154,7 +153,6 @@ TEST_F(EvictableHashTableTest, TestEvict) { } } // namespace ROCKSDB_NAMESPACE -#endif int main(int argc, char** argv) { ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); diff --git a/utilities/persistent_cache/lrulist.h b/utilities/persistent_cache/lrulist.h index a608890fc3e..9a896ed5994 100644 --- a/utilities/persistent_cache/lrulist.h +++ b/utilities/persistent_cache/lrulist.h @@ -5,7 +5,6 @@ // #pragma once -#ifndef ROCKSDB_LITE #include @@ -171,4 +170,3 @@ class LRUList { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/persistent_cache_bench.cc b/utilities/persistent_cache/persistent_cache_bench.cc index 9d6e15d6b68..f2993ee1270 100644 --- a/utilities/persistent_cache/persistent_cache_bench.cc +++ b/utilities/persistent_cache/persistent_cache_bench.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #ifndef GFLAGS #include @@ -354,6 +353,3 @@ int main(int argc, char** argv) { return 0; } #endif // #ifndef GFLAGS -#else -int main(int, char**) { return 0; } -#endif diff --git a/utilities/persistent_cache/persistent_cache_test.cc b/utilities/persistent_cache/persistent_cache_test.cc index 5a185c7cf26..dfbc9b93160 100644 --- a/utilities/persistent_cache/persistent_cache_test.cc +++ b/utilities/persistent_cache/persistent_cache_test.cc @@ -6,7 +6,6 @@ // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#if !defined ROCKSDB_LITE #include "utilities/persistent_cache/persistent_cache_test.h" @@ -412,6 +411,3 @@ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } -#else // !defined ROCKSDB_LITE -int main() { return 0; } -#endif // !defined ROCKSDB_LITE diff --git a/utilities/persistent_cache/persistent_cache_test.h b/utilities/persistent_cache/persistent_cache_test.h index f13155ed6ea..aab61bb773b 100644 --- a/utilities/persistent_cache/persistent_cache_test.h +++ b/utilities/persistent_cache/persistent_cache_test.h @@ -8,7 +8,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -283,4 +282,3 @@ class PersistentCacheDBTest : public DBTestBase { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/persistent_cache_tier.cc b/utilities/persistent_cache/persistent_cache_tier.cc index 54cbce8f707..773aafbf260 100644 --- a/utilities/persistent_cache/persistent_cache_tier.cc +++ b/utilities/persistent_cache/persistent_cache_tier.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "utilities/persistent_cache/persistent_cache_tier.h" @@ -164,4 +163,3 @@ bool PersistentTieredCache::IsCompressed() { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/persistent_cache_tier.h b/utilities/persistent_cache/persistent_cache_tier.h index 65aadcd3f4f..44d2fbba31a 100644 --- a/utilities/persistent_cache/persistent_cache_tier.h +++ b/utilities/persistent_cache/persistent_cache_tier.h @@ -5,7 +5,6 @@ // #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -339,4 +338,3 @@ class PersistentTieredCache : public PersistentCacheTier { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/volatile_tier_impl.cc b/utilities/persistent_cache/volatile_tier_impl.cc index 45d2830aa80..6264f5ef3aa 100644 --- a/utilities/persistent_cache/volatile_tier_impl.cc +++ b/utilities/persistent_cache/volatile_tier_impl.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#ifndef ROCKSDB_LITE #include "utilities/persistent_cache/volatile_tier_impl.h" @@ -137,4 +136,3 @@ bool VolatileCacheTier::Evict() { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/persistent_cache/volatile_tier_impl.h b/utilities/persistent_cache/volatile_tier_impl.h index 09265e457fd..f5d30644381 100644 --- a/utilities/persistent_cache/volatile_tier_impl.h +++ b/utilities/persistent_cache/volatile_tier_impl.h @@ -5,7 +5,6 @@ // #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -138,4 +137,3 @@ class VolatileCacheTier : public PersistentCacheTier { } // namespace ROCKSDB_NAMESPACE -#endif diff --git a/utilities/table_properties_collectors/compact_on_deletion_collector.cc b/utilities/table_properties_collectors/compact_on_deletion_collector.cc index 16f33934dca..95dea67edc3 100644 --- a/utilities/table_properties_collectors/compact_on_deletion_collector.cc +++ b/utilities/table_properties_collectors/compact_on_deletion_collector.cc @@ -15,7 +15,6 @@ #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { -#ifndef ROCKSDB_LITE CompactOnDeletionCollector::CompactOnDeletionCollector( size_t sliding_window_size, size_t deletion_trigger, double deletion_ratio) @@ -100,7 +99,6 @@ Status CompactOnDeletionCollector::Finish( } static std::unordered_map on_deletion_collector_type_info = { -#ifndef ROCKSDB_LITE {"window_size", {0, OptionType::kUnknown, OptionVerificationType::kNormal, OptionTypeFlags::kCompareNever | OptionTypeFlags::kMutable, @@ -156,7 +154,6 @@ static std::unordered_map }, nullptr}}, -#endif // ROCKSDB_LITE }; CompactOnDeletionCollectorFactory::CompactOnDeletionCollectorFactory( @@ -208,18 +205,15 @@ static int RegisterTablePropertiesCollectorFactories( return 1; } } // namespace -#endif // !ROCKSDB_LITE Status TablePropertiesCollectorFactory::CreateFromString( const ConfigOptions& options, const std::string& value, std::shared_ptr* result) { -#ifndef ROCKSDB_LITE static std::once_flag once; std::call_once(once, [&]() { RegisterTablePropertiesCollectorFactories(*(ObjectLibrary::Default().get()), ""); }); -#endif // ROCKSDB_LITE return LoadSharedObject(options, value, nullptr, result); } diff --git a/utilities/table_properties_collectors/compact_on_deletion_collector.h b/utilities/table_properties_collectors/compact_on_deletion_collector.h index 2f7dc4f1b63..c267463a02b 100644 --- a/utilities/table_properties_collectors/compact_on_deletion_collector.h +++ b/utilities/table_properties_collectors/compact_on_deletion_collector.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/table_properties_collectors.h" namespace ROCKSDB_NAMESPACE { @@ -67,4 +66,3 @@ class CompactOnDeletionCollector : public TablePropertiesCollector { bool finished_; }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc b/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc index 88aeb8d5c92..5de18e26243 100644 --- a/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc +++ b/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc @@ -9,7 +9,6 @@ #include -#ifndef ROCKSDB_LITE #include #include #include @@ -237,9 +236,3 @@ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } -#else -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as RocksDBLite does not include utilities.\n"); - return 0; -} -#endif // !ROCKSDB_LITE diff --git a/utilities/trace/replayer_impl.cc b/utilities/trace/replayer_impl.cc index 31023f1a26d..32a5ad7f051 100644 --- a/utilities/trace/replayer_impl.cc +++ b/utilities/trace/replayer_impl.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/trace/replayer_impl.h" @@ -313,4 +312,3 @@ void ReplayerImpl::BackgroundWork(void* arg) { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/trace/replayer_impl.h b/utilities/trace/replayer_impl.h index 367b0b51ed7..f484ab237f0 100644 --- a/utilities/trace/replayer_impl.h +++ b/utilities/trace/replayer_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -83,4 +82,3 @@ struct ReplayerWorkerArg { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/lock_manager.cc b/utilities/transactions/lock/lock_manager.cc index df16b32ad9a..f0bef953b60 100644 --- a/utilities/transactions/lock/lock_manager.cc +++ b/utilities/transactions/lock/lock_manager.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/lock/lock_manager.h" @@ -26,4 +25,3 @@ std::shared_ptr NewLockManager(PessimisticTransactionDB* db, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/lock_manager.h b/utilities/transactions/lock/lock_manager.h index a5ce1948c1d..d90ed9b0077 100644 --- a/utilities/transactions/lock/lock_manager.h +++ b/utilities/transactions/lock/lock_manager.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include "rocksdb/types.h" #include "rocksdb/utilities/transaction.h" @@ -79,4 +78,3 @@ std::shared_ptr NewLockManager(PessimisticTransactionDB* db, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/lock_tracker.h b/utilities/transactions/lock/lock_tracker.h index 5fa228a8290..fe09ab22c59 100644 --- a/utilities/transactions/lock/lock_tracker.h +++ b/utilities/transactions/lock/lock_tracker.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include @@ -206,4 +205,3 @@ class LockTrackerFactory { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/point/point_lock_manager.cc b/utilities/transactions/lock/point/point_lock_manager.cc index b362a164ddd..b73b3fe7618 100644 --- a/utilities/transactions/lock/point/point_lock_manager.cc +++ b/utilities/transactions/lock/point/point_lock_manager.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/lock/point/point_lock_manager.h" @@ -718,4 +717,3 @@ void PointLockManager::UnLock(PessimisticTransaction* /* txn */, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/point/point_lock_manager.h b/utilities/transactions/lock/point/point_lock_manager.h index eeb34f3bec4..99183ca1cd2 100644 --- a/utilities/transactions/lock/point/point_lock_manager.h +++ b/utilities/transactions/lock/point/point_lock_manager.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -221,4 +220,3 @@ class PointLockManager : public LockManager { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/point/point_lock_manager_test.cc b/utilities/transactions/lock/point/point_lock_manager_test.cc index 525fdea7138..00cb37d93d0 100644 --- a/utilities/transactions/lock/point/point_lock_manager_test.cc +++ b/utilities/transactions/lock/point/point_lock_manager_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/lock/point/point_lock_manager_test.h" @@ -169,13 +168,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED because Transactions are not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/point/point_lock_tracker.cc b/utilities/transactions/lock/point/point_lock_tracker.cc index 6204a8f0218..ce86c648688 100644 --- a/utilities/transactions/lock/point/point_lock_tracker.cc +++ b/utilities/transactions/lock/point/point_lock_tracker.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/lock/point/point_lock_tracker.h" @@ -254,4 +253,3 @@ void PointLockTracker::Clear() { tracked_keys_.clear(); } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/point/point_lock_tracker.h b/utilities/transactions/lock/point/point_lock_tracker.h index daf6f9aa276..57e1b8437ab 100644 --- a/utilities/transactions/lock/point/point_lock_tracker.h +++ b/utilities/transactions/lock/point/point_lock_tracker.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -96,4 +95,3 @@ class PointLockTrackerFactory : public LockTrackerFactory { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_lock_manager.h b/utilities/transactions/lock/range/range_lock_manager.h index 01899542e5c..22d653ff675 100644 --- a/utilities/transactions/lock/range/range_lock_manager.h +++ b/utilities/transactions/lock/range/range_lock_manager.h @@ -8,7 +8,6 @@ // Generic definitions for a Range-based Lock Manager // #pragma once -#ifndef ROCKSDB_LITE #include "utilities/transactions/lock/lock_manager.h" @@ -33,4 +32,3 @@ class RangeLockManagerBase : public LockManager { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_locking_test.cc b/utilities/transactions/lock/range/range_locking_test.cc index bce66c1f360..9c044910dfb 100644 --- a/utilities/transactions/lock/range/range_locking_test.cc +++ b/utilities/transactions/lock/range/range_locking_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifndef OS_WIN #include @@ -447,13 +446,3 @@ int main(int /*argc*/, char** /*argv*/) { #endif // OS_WIN -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "skipped as transactions are not supported in rocksdb_lite\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc index 5110cd48253..181a1416de1 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -136,4 +135,3 @@ void concurrent_tree::locked_keyrange::remove_all(void) { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc index e50ace5a9d3..e61dfdfac7b 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -219,4 +218,3 @@ void keyrange::replace_right_key(const DBT *key) { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc index 3d217be70ec..f79c91acff0 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=2:softtabstop=2: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -524,4 +523,3 @@ void lock_request::set_retry_test_callback(void (*f)(void)) { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc index 3d6a590c792..26b6d9f6901 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=2:softtabstop=2: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -1020,4 +1019,3 @@ DICTIONARY_ID locktree::get_dict_id() const { return m_dict_id; } } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc index 4186182beae..bec464e48e4 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -524,4 +523,3 @@ void locktree_manager::kill_waiter(void *extra) { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc index 1e1d23ef8af..eb56b20adfb 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -262,4 +261,3 @@ void range_buffer::append_point(const DBT *key, bool is_exclusive) { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc index 8997f634b06..4e469e38025 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -517,4 +516,3 @@ treenode *treenode::child_ptr::get_locked(void) { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc index 4caf1e26fd8..d7f989043cd 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -117,4 +116,3 @@ TXNID txnid_set::get(uint32_t i) const { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc b/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc index 24536c88ecf..df0073e0d29 100644 --- a/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc +++ b/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -210,4 +209,3 @@ void wfg::node::free(wfg::node *n) { } /* namespace toku */ #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc b/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc index 50dc879ceae..5d0b5228cf1 100644 --- a/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc +++ b/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc @@ -1,4 +1,3 @@ -#ifndef ROCKSDB_LITE #ifndef OS_WIN /* This is a dump ground to make Lock Tree work without the rest of TokuDB. @@ -129,4 +128,3 @@ int toku_builtin_compare_fun(const DBT *a, const DBT *b) { return toku_keycompare(a->data, a->size, b->data, b->size); } #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc b/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc index 63cc3a267a1..4ea6249564c 100644 --- a/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc +++ b/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -150,4 +149,3 @@ bool toku_dbt_equals(const DBT *a, const DBT *b) { } } #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc b/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc index 0e7a9880be5..087cb238d39 100644 --- a/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc +++ b/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc @@ -1,6 +1,5 @@ /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ifndef ROCKSDB_LITE #ifndef OS_WIN #ident "$Id$" /*====== @@ -198,4 +197,3 @@ bool memarena::chunk_iterator::more() const { return _chunk_idx < _ma->_n_other_chunks; } #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc b/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc index 531165deaa0..65ca91b0bab 100644 --- a/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc +++ b/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifndef OS_WIN #include "utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h" @@ -500,4 +499,3 @@ LockManager::RangeLockStatus RangeTreeLockManager::GetRangeLockStatus() { } // namespace ROCKSDB_NAMESPACE #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h b/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h index e4236d600a0..2652add1591 100644 --- a/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h +++ b/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #ifndef OS_WIN // For DeadlockInfoBuffer: @@ -134,4 +133,3 @@ void wait_callback_for_locktree(void* cdata, toku::lock_wait_infos* infos); } // namespace ROCKSDB_NAMESPACE #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc b/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc index be1e1478bc3..5bfb8633767 100644 --- a/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc +++ b/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #ifndef OS_WIN #include "utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.h" @@ -153,4 +152,3 @@ void RangeLockList::ReplaceLocks(const toku::locktree *lt, } // namespace ROCKSDB_NAMESPACE #endif // OS_WIN -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/optimistic_transaction.cc b/utilities/transactions/optimistic_transaction.cc index 0ee0f28b674..af629b528a3 100644 --- a/utilities/transactions/optimistic_transaction.cc +++ b/utilities/transactions/optimistic_transaction.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/optimistic_transaction.h" @@ -193,4 +192,3 @@ Status OptimisticTransaction::SetName(const TransactionName& /* unused */) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/optimistic_transaction.h b/utilities/transactions/optimistic_transaction.h index de23233d573..a03fa16970f 100644 --- a/utilities/transactions/optimistic_transaction.h +++ b/utilities/transactions/optimistic_transaction.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -98,4 +97,3 @@ class OptimisticTransactionCallback : public WriteCallback { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/optimistic_transaction_db_impl.cc b/utilities/transactions/optimistic_transaction_db_impl.cc index bffb3d5ed8d..3a816153353 100644 --- a/utilities/transactions/optimistic_transaction_db_impl.cc +++ b/utilities/transactions/optimistic_transaction_db_impl.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/optimistic_transaction_db_impl.h" @@ -108,4 +107,3 @@ void OptimisticTransactionDBImpl::ReinitializeTransaction( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/optimistic_transaction_db_impl.h b/utilities/transactions/optimistic_transaction_db_impl.h index 88e86ea4a67..fef145356e2 100644 --- a/utilities/transactions/optimistic_transaction_db_impl.h +++ b/utilities/transactions/optimistic_transaction_db_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -85,4 +84,3 @@ class OptimisticTransactionDBImpl : public OptimisticTransactionDB { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/optimistic_transaction_test.cc b/utilities/transactions/optimistic_transaction_test.cc index aa8192c325b..af125a36d65 100644 --- a/utilities/transactions/optimistic_transaction_test.cc +++ b/utilities/transactions/optimistic_transaction_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include #include @@ -1478,14 +1477,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf( - stderr, - "SKIPPED as optimistic_transaction is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/utilities/transactions/pessimistic_transaction.cc b/utilities/transactions/pessimistic_transaction.cc index cb8fd3bb61c..63c689efd79 100644 --- a/utilities/transactions/pessimistic_transaction.cc +++ b/utilities/transactions/pessimistic_transaction.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/pessimistic_transaction.h" @@ -1172,4 +1171,3 @@ Status PessimisticTransaction::SetName(const TransactionName& name) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/pessimistic_transaction.h b/utilities/transactions/pessimistic_transaction.h index d43d1d3ac50..ffff50974a2 100644 --- a/utilities/transactions/pessimistic_transaction.h +++ b/utilities/transactions/pessimistic_transaction.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -310,4 +309,3 @@ class WriteCommittedTxn : public PessimisticTransaction { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/pessimistic_transaction_db.cc b/utilities/transactions/pessimistic_transaction_db.cc index 950ef80422d..8009bef197b 100644 --- a/utilities/transactions/pessimistic_transaction_db.cc +++ b/utilities/transactions/pessimistic_transaction_db.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/pessimistic_transaction_db.h" @@ -779,4 +778,3 @@ Status SnapshotCreationCallback::operator()(SequenceNumber seq, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/pessimistic_transaction_db.h b/utilities/transactions/pessimistic_transaction_db.h index 25cd1105409..b662048bd49 100644 --- a/utilities/transactions/pessimistic_transaction_db.h +++ b/utilities/transactions/pessimistic_transaction_db.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -315,4 +314,3 @@ class SnapshotCreationCallback : public PostMemTableCallback { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/snapshot_checker.cc b/utilities/transactions/snapshot_checker.cc index 76d16681a17..da363a12fbf 100644 --- a/utilities/transactions/snapshot_checker.cc +++ b/utilities/transactions/snapshot_checker.cc @@ -5,27 +5,12 @@ #include "db/snapshot_checker.h" -#ifdef ROCKSDB_LITE -#include -#endif // ROCKSDB_LITE #include "port/lang.h" #include "utilities/transactions/write_prepared_txn_db.h" namespace ROCKSDB_NAMESPACE { -#ifdef ROCKSDB_LITE -WritePreparedSnapshotChecker::WritePreparedSnapshotChecker( - WritePreparedTxnDB* /*txn_db*/) {} - -SnapshotCheckerResult WritePreparedSnapshotChecker::CheckInSnapshot( - SequenceNumber /*sequence*/, SequenceNumber /*snapshot_sequence*/) const { - // Should never be called in LITE mode. - assert(false); - return SnapshotCheckerResult::kInSnapshot; -} - -#else WritePreparedSnapshotChecker::WritePreparedSnapshotChecker( WritePreparedTxnDB* txn_db) @@ -44,7 +29,6 @@ SnapshotCheckerResult WritePreparedSnapshotChecker::CheckInSnapshot( : SnapshotCheckerResult::kNotInSnapshot; } -#endif // ROCKSDB_LITE DisableGCSnapshotChecker* DisableGCSnapshotChecker::Instance() { STATIC_AVOID_DESTRUCTION(DisableGCSnapshotChecker, instance); diff --git a/utilities/transactions/timestamped_snapshot_test.cc b/utilities/transactions/timestamped_snapshot_test.cc index e9b474415d0..9681b0157ad 100644 --- a/utilities/transactions/timestamped_snapshot_test.cc +++ b/utilities/transactions/timestamped_snapshot_test.cc @@ -3,14 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifdef ROCKSDB_LITE -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as Transactions are not supported in LITE mode\n"); - return 0; -} -#else // ROCKSDB_LITE #include #include "util/cast_util.h" @@ -463,4 +455,3 @@ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } -#endif // !ROCKSDB_LITE diff --git a/utilities/transactions/transaction_base.cc b/utilities/transactions/transaction_base.cc index 83fd94ac855..10d5d02a190 100644 --- a/utilities/transactions/transaction_base.cc +++ b/utilities/transactions/transaction_base.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/transaction_base.h" @@ -728,4 +727,3 @@ WriteBatch* TransactionBaseImpl::GetCommitTimeWriteBatch() { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/transaction_base.h b/utilities/transactions/transaction_base.h index 1bcb20ca90b..bde09b69917 100644 --- a/utilities/transactions/transaction_base.h +++ b/utilities/transactions/transaction_base.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -381,4 +380,3 @@ class TransactionBaseImpl : public Transaction { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/transaction_db_mutex_impl.cc b/utilities/transactions/transaction_db_mutex_impl.cc index 345c4be902f..52c299b376a 100644 --- a/utilities/transactions/transaction_db_mutex_impl.cc +++ b/utilities/transactions/transaction_db_mutex_impl.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/transaction_db_mutex_impl.h" @@ -132,4 +131,3 @@ Status TransactionDBCondVarImpl::WaitFor( } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/transaction_db_mutex_impl.h b/utilities/transactions/transaction_db_mutex_impl.h index fbee9283208..f509f4017a5 100644 --- a/utilities/transactions/transaction_db_mutex_impl.h +++ b/utilities/transactions/transaction_db_mutex_impl.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/transaction_db_mutex.h" @@ -23,4 +22,3 @@ class TransactionDBMutexFactoryImpl : public TransactionDBMutexFactory { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/transaction_test.cc b/utilities/transactions/transaction_test.cc index d74a4b8b116..695c7c4c53d 100644 --- a/utilities/transactions/transaction_test.cc +++ b/utilities/transactions/transaction_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/transaction_test.h" @@ -6649,13 +6648,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as Transactions are not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/transaction_util.cc b/utilities/transactions/transaction_util.cc index 360edc8ec1a..d5a68807e77 100644 --- a/utilities/transactions/transaction_util.cc +++ b/utilities/transactions/transaction_util.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/transaction_util.h" @@ -203,4 +202,3 @@ Status TransactionUtil::CheckKeysForConflicts(DBImpl* db_impl, } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/transaction_util.h b/utilities/transactions/transaction_util.h index a349ba87a65..725e1c92790 100644 --- a/utilities/transactions/transaction_util.h +++ b/utilities/transactions/transaction_util.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -82,4 +81,3 @@ class TransactionUtil { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_committed_transaction_ts_test.cc b/utilities/transactions/write_committed_transaction_ts_test.cc index 94b8201f7ae..e23851a3153 100644 --- a/utilities/transactions/write_committed_transaction_ts_test.cc +++ b/utilities/transactions/write_committed_transaction_ts_test.cc @@ -7,7 +7,6 @@ #include "rocksdb/options.h" #include "rocksdb/utilities/transaction_db.h" #include "utilities/merge_operators.h" -#ifndef ROCKSDB_LITE #include "test_util/testutil.h" #include "utilities/transactions/transaction_test.h" @@ -577,12 +576,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as Transactions not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_prepared_transaction_test.cc b/utilities/transactions/write_prepared_transaction_test.cc index 86a9511a44b..7f52e7285a9 100644 --- a/utilities/transactions/write_prepared_transaction_test.cc +++ b/utilities/transactions/write_prepared_transaction_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include #include @@ -4066,13 +4065,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as Transactions are not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_prepared_txn.cc b/utilities/transactions/write_prepared_txn.cc index 16b5cc1cbce..ededb6250e3 100644 --- a/utilities/transactions/write_prepared_txn.cc +++ b/utilities/transactions/write_prepared_txn.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/write_prepared_txn.h" @@ -509,4 +508,3 @@ Status WritePreparedTxn::RebuildFromWriteBatch(WriteBatch* src_batch) { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_prepared_txn.h b/utilities/transactions/write_prepared_txn.h index 30d9bdb99bf..f621e37abaf 100644 --- a/utilities/transactions/write_prepared_txn.h +++ b/utilities/transactions/write_prepared_txn.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -116,4 +115,3 @@ class WritePreparedTxn : public PessimisticTransaction { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_prepared_txn_db.cc b/utilities/transactions/write_prepared_txn_db.cc index 595c3df8f52..84c45b7e4b5 100644 --- a/utilities/transactions/write_prepared_txn_db.cc +++ b/utilities/transactions/write_prepared_txn_db.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/write_prepared_txn_db.h" @@ -1027,4 +1026,3 @@ void SubBatchCounter::AddKey(const uint32_t cf, const Slice& key) { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_prepared_txn_db.h b/utilities/transactions/write_prepared_txn_db.h index 25a38247358..f5b6411605a 100644 --- a/utilities/transactions/write_prepared_txn_db.h +++ b/utilities/transactions/write_prepared_txn_db.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -1122,4 +1121,3 @@ bool WritePreparedTxnDB::ValidateSnapshot( } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_unprepared_transaction_test.cc b/utilities/transactions/write_unprepared_transaction_test.cc index 6c8c62e0e04..bdc3246342b 100644 --- a/utilities/transactions/write_unprepared_transaction_test.cc +++ b/utilities/transactions/write_unprepared_transaction_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/transaction_test.h" #include "utilities/transactions/write_unprepared_txn.h" @@ -778,13 +777,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, - "SKIPPED as Transactions are not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_unprepared_txn.cc b/utilities/transactions/write_unprepared_txn.cc index 6e04d33442c..11e04824f31 100644 --- a/utilities/transactions/write_unprepared_txn.cc +++ b/utilities/transactions/write_unprepared_txn.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/write_unprepared_txn.h" @@ -1050,4 +1049,3 @@ WriteUnpreparedTxn::GetUnpreparedSequenceNumbers() { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_unprepared_txn.h b/utilities/transactions/write_unprepared_txn.h index 5a3227f4ee6..63c65f00aeb 100644 --- a/utilities/transactions/write_unprepared_txn.h +++ b/utilities/transactions/write_unprepared_txn.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include @@ -338,4 +337,3 @@ class WriteUnpreparedTxn : public WritePreparedTxn { } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_unprepared_txn_db.cc b/utilities/transactions/write_unprepared_txn_db.cc index 2ed2d5c59bb..26a03c77d97 100644 --- a/utilities/transactions/write_unprepared_txn_db.cc +++ b/utilities/transactions/write_unprepared_txn_db.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/transactions/write_unprepared_txn_db.h" @@ -470,4 +469,3 @@ Iterator* WriteUnpreparedTxnDB::NewIterator(const ReadOptions& options, } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/transactions/write_unprepared_txn_db.h b/utilities/transactions/write_unprepared_txn_db.h index c40e96d4966..a7b10f15336 100644 --- a/utilities/transactions/write_unprepared_txn_db.h +++ b/utilities/transactions/write_unprepared_txn_db.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include "utilities/transactions/write_prepared_txn_db.h" #include "utilities/transactions/write_unprepared_txn.h" @@ -105,4 +104,3 @@ class WriteUnpreparedCommitEntryPreReleaseCallback : public PreReleaseCallback { }; } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/ttl/db_ttl_impl.cc b/utilities/ttl/db_ttl_impl.cc index 3bfc66649a7..c38efa5fef7 100644 --- a/utilities/ttl/db_ttl_impl.cc +++ b/utilities/ttl/db_ttl_impl.cc @@ -2,7 +2,6 @@ // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "utilities/ttl/db_ttl_impl.h" @@ -607,4 +606,3 @@ void DBWithTTLImpl::SetTtl(ColumnFamilyHandle* h, int32_t ttl) { } } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/ttl/db_ttl_impl.h b/utilities/ttl/db_ttl_impl.h index dd67a6ddc36..6ac662467f1 100644 --- a/utilities/ttl/db_ttl_impl.h +++ b/utilities/ttl/db_ttl_impl.h @@ -5,7 +5,6 @@ #pragma once -#ifndef ROCKSDB_LITE #include #include #include @@ -242,4 +241,3 @@ int RegisterTtlObjects(ObjectLibrary& library, const std::string& /*arg*/); } // extern "C" } // namespace ROCKSDB_NAMESPACE -#endif // ROCKSDB_LITE diff --git a/utilities/ttl/ttl_test.cc b/utilities/ttl/ttl_test.cc index a42e0acb4ea..23cb23caf4a 100644 --- a/utilities/ttl/ttl_test.cc +++ b/utilities/ttl/ttl_test.cc @@ -3,7 +3,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include #include @@ -901,12 +900,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main(int /*argc*/, char** /*argv*/) { - fprintf(stderr, "SKIPPED as DBWithTTL is not supported in ROCKSDB_LITE\n"); - return 0; -} - -#endif // !ROCKSDB_LITE diff --git a/utilities/write_batch_with_index/write_batch_with_index.cc b/utilities/write_batch_with_index/write_batch_with_index.cc index 408243b3fff..8192525bd28 100644 --- a/utilities/write_batch_with_index/write_batch_with_index.cc +++ b/utilities/write_batch_with_index/write_batch_with_index.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/write_batch_with_index.h" @@ -692,4 +691,3 @@ const Comparator* WriteBatchWithIndexInternal::GetUserComparator( } } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/write_batch_with_index/write_batch_with_index_internal.cc b/utilities/write_batch_with_index/write_batch_with_index_internal.cc index 5ae4df7dd05..ee4754f8d1e 100644 --- a/utilities/write_batch_with_index/write_batch_with_index_internal.cc +++ b/utilities/write_batch_with_index/write_batch_with_index_internal.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#ifndef ROCKSDB_LITE #include "utilities/write_batch_with_index/write_batch_with_index_internal.h" @@ -741,4 +740,3 @@ WBWIIteratorImpl::Result WriteBatchWithIndexInternal::GetFromBatch( } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/write_batch_with_index/write_batch_with_index_internal.h b/utilities/write_batch_with_index/write_batch_with_index_internal.h index edabc95bcda..031d72889e2 100644 --- a/utilities/write_batch_with_index/write_batch_with_index_internal.h +++ b/utilities/write_batch_with_index/write_batch_with_index_internal.h @@ -4,7 +4,6 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#ifndef ROCKSDB_LITE #include #include @@ -341,4 +340,3 @@ class WriteBatchWithIndexInternal { }; } // namespace ROCKSDB_NAMESPACE -#endif // !ROCKSDB_LITE diff --git a/utilities/write_batch_with_index/write_batch_with_index_test.cc b/utilities/write_batch_with_index/write_batch_with_index_test.cc index 350dcc881e0..7330c82ca22 100644 --- a/utilities/write_batch_with_index/write_batch_with_index_test.cc +++ b/utilities/write_batch_with_index/write_batch_with_index_test.cc @@ -7,7 +7,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef ROCKSDB_LITE #include "rocksdb/utilities/write_batch_with_index.h" @@ -2408,12 +2407,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else -#include - -int main() { - fprintf(stderr, "SKIPPED\n"); - return 0; -} - -#endif // !ROCKSDB_LITE