diff --git a/CMakeLists.txt b/CMakeLists.txt index 32c52a256..fab8397e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -316,7 +316,6 @@ set(SOURCES db/log_writer.cc db/managed_iterator.cc db/memtable.cc - db/memtable_allocator.cc db/memtable_list.cc db/merge_helper.cc db/merge_operator.cc @@ -341,6 +340,7 @@ set(SOURCES memtable/hash_cuckoo_rep.cc memtable/hash_linklist_rep.cc memtable/hash_skiplist_rep.cc + memtable/memtable_allocator.cc memtable/skiplistrep.cc memtable/vectorrep.cc monitoring/histogram.cc @@ -590,7 +590,6 @@ set(TESTS db/file_indexer_test.cc db/filename_test.cc db/flush_job_test.cc - db/inlineskiplist_test.cc db/listener_test.cc db/log_test.cc db/manual_compaction_test.cc @@ -602,7 +601,6 @@ set(TESTS db/plain_table_db_test.cc db/prefix_test.cc db/repair_test.cc - db/skiplist_test.cc db/table_properties_collector_test.cc db/version_builder_test.cc db/version_edit_test.cc @@ -614,6 +612,8 @@ set(TESTS env/env_basic_test.cc env/env_test.cc env/mock_env_test.cc + memtable/inlineskiplist_test.cc + memtable/skiplist_test.cc monitoring/histogram_test.cc monitoring/iostats_context_test.cc monitoring/statistics_test.cc @@ -674,10 +674,10 @@ if(WITH_LIBRADOS) endif() set(BENCHMARKS + cache/cache_bench.cc + memtable/memtablerep_bench.cc tools/db_bench.cc table/table_reader_bench.cc - cache/cache_bench.cc - db/memtablerep_bench.cc utilities/column_aware_encoding_exp.cc utilities/persistent_cache/hash_table_bench.cc) add_library(testharness OBJECT util/testharness.cc) diff --git a/Makefile b/Makefile index 662823dec..80bfdedd6 100644 --- a/Makefile +++ b/Makefile @@ -907,7 +907,7 @@ cache_bench: cache/cache_bench.o $(LIBOBJECTS) $(TESTUTIL) persistent_cache_bench: utilities/persistent_cache/persistent_cache_bench.o $(LIBOBJECTS) $(TESTUTIL) $(AM_LINK) -memtablerep_bench: db/memtablerep_bench.o $(LIBOBJECTS) $(TESTUTIL) +memtablerep_bench: memtable/memtablerep_bench.o $(LIBOBJECTS) $(TESTUTIL) $(AM_LINK) db_stress: tools/db_stress.o $(LIBOBJECTS) $(TESTUTIL) @@ -1179,10 +1179,10 @@ table_test: table/table_test.o $(LIBOBJECTS) $(TESTHARNESS) block_test: table/block_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -inlineskiplist_test: db/inlineskiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) +inlineskiplist_test: memtable/inlineskiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -skiplist_test: db/skiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) +skiplist_test: memtable/skiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) version_edit_test: db/version_edit_test.o $(LIBOBJECTS) $(TESTHARNESS) diff --git a/db/compaction_job.cc b/db/compaction_job.cc index f2112ee32..b427d3e40 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -55,6 +55,7 @@ #include "util/log_buffer.h" #include "util/logging.h" #include "util/mutexlock.h" +#include "util/random.h" #include "util/sst_file_manager_impl.h" #include "util/stop_watch.h" #include "util/string_util.h" diff --git a/db/flush_job.cc b/db/flush_job.cc index fe68e3199..6dc5915ff 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -24,7 +24,6 @@ #include "db/event_helpers.h" #include "db/log_reader.h" #include "db/log_writer.h" -#include "db/memtable.h" #include "db/memtable_list.h" #include "db/merge_context.h" #include "db/version_set.h" @@ -33,6 +32,7 @@ #include "monitoring/thread_status_util.h" #include "port/likely.h" #include "port/port.h" +#include "db/memtable.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/statistics.h" diff --git a/db/memtable.h b/db/memtable.h index a37aac03d..92cbce972 100644 --- a/db/memtable.h +++ b/db/memtable.h @@ -16,10 +16,9 @@ #include #include #include "db/dbformat.h" -#include "db/memtable_allocator.h" #include "db/range_del_aggregator.h" -#include "db/skiplist.h" #include "db/version_edit.h" +#include "memtable/memtable_allocator.h" #include "monitoring/instrumented_mutex.h" #include "options/cf_options.h" #include "rocksdb/db.h" diff --git a/db/memtable_list.h b/db/memtable_list.h index 26d386c8b..e2488b5ae 100644 --- a/db/memtable_list.h +++ b/db/memtable_list.h @@ -14,7 +14,6 @@ #include "db/dbformat.h" #include "db/memtable.h" #include "db/range_del_aggregator.h" -#include "db/skiplist.h" #include "monitoring/instrumented_mutex.h" #include "rocksdb/db.h" #include "rocksdb/iterator.h" diff --git a/db/write_callback_test.cc b/db/write_callback_test.cc index a59281f12..5673193aa 100644 --- a/db/write_callback_test.cc +++ b/db/write_callback_test.cc @@ -16,6 +16,7 @@ #include "rocksdb/write_batch.h" #include "port/port.h" #include "util/logging.h" +#include "util/random.h" #include "util/sync_point.h" #include "util/testharness.h" diff --git a/db/write_thread.cc b/db/write_thread.cc index 048eca42c..02943fae5 100644 --- a/db/write_thread.cc +++ b/db/write_thread.cc @@ -9,6 +9,7 @@ #include #include "db/column_family.h" #include "port/port.h" +#include "util/random.h" #include "util/sync_point.h" namespace rocksdb { diff --git a/memtable/hash_cuckoo_rep.cc b/memtable/hash_cuckoo_rep.cc index a8799f1ca..30cb41b7d 100644 --- a/memtable/hash_cuckoo_rep.cc +++ b/memtable/hash_cuckoo_rep.cc @@ -16,7 +16,7 @@ #include #include "db/memtable.h" -#include "db/skiplist.h" +#include "memtable/skiplist.h" #include "memtable/stl_wrappers.h" #include "port/port.h" #include "rocksdb/memtablerep.h" diff --git a/memtable/hash_linklist_rep.cc b/memtable/hash_linklist_rep.cc index 48a6d9897..59559d5b7 100644 --- a/memtable/hash_linklist_rep.cc +++ b/memtable/hash_linklist_rep.cc @@ -10,7 +10,7 @@ #include #include #include "db/memtable.h" -#include "db/skiplist.h" +#include "memtable/skiplist.h" #include "monitoring/histogram.h" #include "port/port.h" #include "rocksdb/memtablerep.h" diff --git a/memtable/hash_skiplist_rep.cc b/memtable/hash_skiplist_rep.cc index 12b47950d..307fad650 100644 --- a/memtable/hash_skiplist_rep.cc +++ b/memtable/hash_skiplist_rep.cc @@ -16,7 +16,7 @@ #include "port/port.h" #include "util/murmurhash.h" #include "db/memtable.h" -#include "db/skiplist.h" +#include "memtable/skiplist.h" namespace rocksdb { namespace { diff --git a/db/inlineskiplist.h b/memtable/inlineskiplist.h similarity index 100% rename from db/inlineskiplist.h rename to memtable/inlineskiplist.h diff --git a/db/inlineskiplist_test.cc b/memtable/inlineskiplist_test.cc similarity index 99% rename from db/inlineskiplist_test.cc rename to memtable/inlineskiplist_test.cc index a06c49898..56ab49b81 100644 --- a/db/inlineskiplist_test.cc +++ b/memtable/inlineskiplist_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. -#include "db/inlineskiplist.h" +#include "memtable/inlineskiplist.h" #include #include #include "rocksdb/env.h" diff --git a/db/memtable_allocator.cc b/memtable/memtable_allocator.cc similarity index 98% rename from db/memtable_allocator.cc rename to memtable/memtable_allocator.cc index 9a7204dd8..08a7dbf74 100644 --- a/db/memtable_allocator.cc +++ b/memtable/memtable_allocator.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. -#include "db/memtable_allocator.h" +#include "memtable/memtable_allocator.h" #include #include "rocksdb/write_buffer_manager.h" diff --git a/db/memtable_allocator.h b/memtable/memtable_allocator.h similarity index 100% rename from db/memtable_allocator.h rename to memtable/memtable_allocator.h diff --git a/db/memtablerep_bench.cc b/memtable/memtablerep_bench.cc similarity index 100% rename from db/memtablerep_bench.cc rename to memtable/memtablerep_bench.cc diff --git a/db/skiplist.h b/memtable/skiplist.h similarity index 100% rename from db/skiplist.h rename to memtable/skiplist.h diff --git a/db/skiplist_test.cc b/memtable/skiplist_test.cc similarity index 99% rename from db/skiplist_test.cc rename to memtable/skiplist_test.cc index 80f696d29..cd0e94287 100644 --- a/db/skiplist_test.cc +++ b/memtable/skiplist_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. -#include "db/skiplist.h" +#include "memtable/skiplist.h" #include #include "rocksdb/env.h" #include "util/arena.h" diff --git a/memtable/skiplistrep.cc b/memtable/skiplistrep.cc index d07fa1218..363ebe286 100644 --- a/memtable/skiplistrep.cc +++ b/memtable/skiplistrep.cc @@ -3,7 +3,7 @@ // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // -#include "db/inlineskiplist.h" +#include "memtable/inlineskiplist.h" #include "db/memtable.h" #include "rocksdb/memtablerep.h" #include "util/arena.h" diff --git a/src.mk b/src.mk index f6fb301b2..ca776dd0f 100644 --- a/src.mk +++ b/src.mk @@ -1,8 +1,8 @@ # These are the sources from which librocksdb.a is built: LIB_SOURCES = \ - cache/clock_cache.cc \ - cache/lru_cache.cc \ - cache/sharded_cache.cc \ + cache/clock_cache.cc \ + cache/lru_cache.cc \ + cache/sharded_cache.cc \ db/builder.cc \ db/c.cc \ db/column_family.cc \ @@ -15,9 +15,9 @@ LIB_SOURCES = \ db/db_filesnapshot.cc \ db/db_impl.cc \ db/db_impl_write.cc \ - db/db_impl_compaction_flush.cc \ + db/db_impl_compaction_flush.cc \ db/db_impl_files.cc \ - db/db_impl_open.cc \ + db/db_impl_open.cc \ db/db_impl_debug.cc \ db/db_impl_experimental.cc \ db/db_impl_readonly.cc \ @@ -36,7 +36,6 @@ LIB_SOURCES = \ db/log_writer.cc \ db/managed_iterator.cc \ db/memtable.cc \ - db/memtable_allocator.cc \ db/memtable_list.cc \ db/merge_helper.cc \ db/merge_operator.cc \ @@ -54,35 +53,36 @@ LIB_SOURCES = \ db/write_batch_base.cc \ db/write_controller.cc \ db/write_thread.cc \ - env/env.cc \ - env/env_chroot.cc \ - env/env_hdfs.cc \ - env/env_posix.cc \ - env/io_posix.cc \ - env/memenv.cc \ + env/env.cc \ + env/env_chroot.cc \ + env/env_hdfs.cc \ + env/env_posix.cc \ + env/io_posix.cc \ + env/memenv.cc \ memtable/hash_cuckoo_rep.cc \ memtable/hash_linklist_rep.cc \ memtable/hash_skiplist_rep.cc \ + memtable/memtable_allocator.cc \ memtable/skiplistrep.cc \ memtable/vectorrep.cc \ - monitoring/histogram.cc \ - monitoring/histogram_windowing.cc \ - monitoring/instrumented_mutex.cc \ - monitoring/iostats_context.cc \ - monitoring/perf_context.cc \ - monitoring/perf_level.cc \ - monitoring/statistics.cc \ - monitoring/thread_status_impl.cc \ - monitoring/thread_status_updater.cc \ - monitoring/thread_status_updater_debug.cc \ - monitoring/thread_status_util.cc \ - monitoring/thread_status_util_debug.cc \ - options/cf_options.cc \ - options/db_options.cc \ - options/options.cc \ - options/options_helper.cc \ - options/options_parser.cc \ - options/options_sanity_check.cc \ + monitoring/histogram.cc \ + monitoring/histogram_windowing.cc \ + monitoring/instrumented_mutex.cc \ + monitoring/iostats_context.cc \ + monitoring/perf_context.cc \ + monitoring/perf_level.cc \ + monitoring/statistics.cc \ + monitoring/thread_status_impl.cc \ + monitoring/thread_status_updater.cc \ + monitoring/thread_status_updater_debug.cc \ + monitoring/thread_status_util.cc \ + monitoring/thread_status_util_debug.cc \ + options/cf_options.cc \ + options/db_options.cc \ + options/options.cc \ + options/options_helper.cc \ + options/options_parser.cc \ + options/options_sanity_check.cc \ port/port_posix.cc \ port/stack_trace.cc \ table/adaptive_table_factory.cc \ @@ -254,17 +254,14 @@ MAIN_SOURCES = \ db/file_indexer_test.cc \ db/filename_test.cc \ db/flush_job_test.cc \ - db/inlineskiplist_test.cc \ db/listener_test.cc \ db/log_test.cc \ db/manual_compaction_test.cc \ - db/memtablerep_bench.cc \ db/merge_test.cc \ db/options_file_test.cc \ db/perf_context_test.cc \ db/plain_table_db_test.cc \ db/prefix_test.cc \ - db/skiplist_test.cc \ db/table_properties_collector_test.cc \ db/version_builder_test.cc \ db/version_edit_test.cc \ @@ -273,13 +270,16 @@ MAIN_SOURCES = \ db/write_batch_test.cc \ db/write_callback_test.cc \ db/write_controller_test.cc \ - env/env_basic_test.cc \ - env/env_test.cc \ - env/mock_env_test.cc \ - monitoring/histogram_test.cc \ - monitoring/iostats_context_test.cc \ - monitoring/statistics_test.cc \ - options/options_test.cc \ + env/env_basic_test.cc \ + env/env_test.cc \ + env/mock_env_test.cc \ + memtable/inlineskiplist_test.cc \ + memtable/memtablerep_bench.cc \ + memtable/skiplist_test.cc \ + monitoring/histogram_test.cc \ + monitoring/iostats_context_test.cc \ + monitoring/statistics_test.cc \ + options/options_test.cc \ table/block_based_filter_block_test.cc \ table/block_test.cc \ table/cuckoo_table_builder_test.cc \ diff --git a/table/block_test.cc b/table/block_test.cc index 7d54b7665..dd4ada6de 100644 --- a/table/block_test.cc +++ b/table/block_test.cc @@ -12,8 +12,8 @@ #include #include "db/dbformat.h" -#include "db/memtable.h" #include "db/write_batch_internal.h" +#include "db/memtable.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/iterator.h" diff --git a/util/fault_injection_test_env.h b/util/fault_injection_test_env.h index eb0568e73..4827935eb 100644 --- a/util/fault_injection_test_env.h +++ b/util/fault_injection_test_env.h @@ -24,6 +24,7 @@ #include "rocksdb/env.h" #include "util/filename.h" #include "util/mutexlock.h" +#include "util/random.h" namespace rocksdb { diff --git a/utilities/persistent_cache/block_cache_tier.h b/utilities/persistent_cache/block_cache_tier.h index 246a5b893..d01143552 100644 --- a/utilities/persistent_cache/block_cache_tier.h +++ b/utilities/persistent_cache/block_cache_tier.h @@ -26,7 +26,7 @@ #include "utilities/persistent_cache/block_cache_tier_metadata.h" #include "utilities/persistent_cache/persistent_cache_util.h" -#include "db/skiplist.h" +#include "memtable/skiplist.h" #include "monitoring/histogram.h" #include "port/port.h" #include "util/arena.h" 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 cfceaeeee..43aee5bb9 100644 --- a/utilities/write_batch_with_index/write_batch_with_index.cc +++ b/utilities/write_batch_with_index/write_batch_with_index.cc @@ -14,7 +14,7 @@ #include "db/db_impl.h" #include "db/merge_context.h" #include "db/merge_helper.h" -#include "db/skiplist.h" +#include "memtable/skiplist.h" #include "options/db_options.h" #include "rocksdb/comparator.h" #include "rocksdb/iterator.h" 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 1898fc62f..30c806a1e 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 @@ -14,6 +14,7 @@ #include "db/column_family.h" #include "port/stack_trace.h" #include "rocksdb/utilities/write_batch_with_index.h" +#include "util/random.h" #include "util/string_util.h" #include "util/testharness.h" #include "utilities/merge_operators.h"