diff --git a/CMakeLists.txt b/CMakeLists.txt index 81cec6633c..1668d24b97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -583,7 +583,6 @@ set(SOURCES db/builder.cc db/c.cc db/column_family.cc - db/compacted_db_impl.cc db/compaction/compaction.cc db/compaction/compaction_iterator.cc db/compaction/compaction_picker.cc @@ -594,6 +593,7 @@ set(SOURCES db/compaction/sst_partitioner.cc db/convenience.cc db/db_filesnapshot.cc + db/db_impl/compacted_db_impl.cc db/db_impl/db_impl.cc db/db_impl/db_impl_write.cc db/db_impl/db_impl_compaction_flush.cc diff --git a/TARGETS b/TARGETS index 61c48ef2c6..3b73b164c8 100644 --- a/TARGETS +++ b/TARGETS @@ -146,7 +146,6 @@ cpp_library( "db/builder.cc", "db/c.cc", "db/column_family.cc", - "db/compacted_db_impl.cc", "db/compaction/compaction.cc", "db/compaction/compaction_iterator.cc", "db/compaction/compaction_job.cc", @@ -157,6 +156,7 @@ cpp_library( "db/compaction/sst_partitioner.cc", "db/convenience.cc", "db/db_filesnapshot.cc", + "db/db_impl/compacted_db_impl.cc", "db/db_impl/db_impl.cc", "db/db_impl/db_impl_compaction_flush.cc", "db/db_impl/db_impl_debug.cc", @@ -453,7 +453,6 @@ cpp_library( "db/builder.cc", "db/c.cc", "db/column_family.cc", - "db/compacted_db_impl.cc", "db/compaction/compaction.cc", "db/compaction/compaction_iterator.cc", "db/compaction/compaction_job.cc", @@ -464,6 +463,7 @@ cpp_library( "db/compaction/sst_partitioner.cc", "db/convenience.cc", "db/db_filesnapshot.cc", + "db/db_impl/compacted_db_impl.cc", "db/db_impl/db_impl.cc", "db/db_impl/db_impl_compaction_flush.cc", "db/db_impl/db_impl_debug.cc", diff --git a/db/compacted_db_impl.cc b/db/db_impl/compacted_db_impl.cc similarity index 98% rename from db/compacted_db_impl.cc rename to db/db_impl/compacted_db_impl.cc index cd4f27b9e6..3eb8736045 100644 --- a/db/compacted_db_impl.cc +++ b/db/db_impl/compacted_db_impl.cc @@ -4,7 +4,7 @@ // (found in the LICENSE.Apache file in the root directory). #ifndef ROCKSDB_LITE -#include "db/compacted_db_impl.h" +#include "db/db_impl/compacted_db_impl.h" #include "db/db_impl/db_impl.h" #include "db/version_set.h" @@ -78,6 +78,7 @@ std::vector CompactedDBImpl::MultiGet(const ReadOptions& options, nullptr, nullptr, nullptr, true, nullptr, nullptr); LookupKey lkey(keys[idx], kMaxSequenceNumber); Status s = r->Get(options, lkey.internal_key(), &get_context, nullptr); + assert(static_cast(idx) < statuses.size()); if (!s.ok() && !s.IsNotFound()) { statuses[idx] = s; } else { diff --git a/db/compacted_db_impl.h b/db/db_impl/compacted_db_impl.h similarity index 99% rename from db/compacted_db_impl.h rename to db/db_impl/compacted_db_impl.h index d57436f0ae..4cf00785e2 100644 --- a/db/compacted_db_impl.h +++ b/db/db_impl/compacted_db_impl.h @@ -18,7 +18,7 @@ class CompactedDBImpl : public DBImpl { CompactedDBImpl(const CompactedDBImpl&) = delete; void operator=(const CompactedDBImpl&) = delete; - virtual ~CompactedDBImpl(); + ~CompactedDBImpl() override; static Status Open(const Options& options, const std::string& dbname, DB** dbptr); diff --git a/db/db_impl/db_impl_readonly.cc b/db/db_impl/db_impl_readonly.cc index 1866cf447c..5576d299c6 100644 --- a/db/db_impl/db_impl_readonly.cc +++ b/db/db_impl/db_impl_readonly.cc @@ -6,7 +6,7 @@ #include "db/db_impl/db_impl_readonly.h" #include "db/arena_wrapped_db_iter.h" -#include "db/compacted_db_impl.h" +#include "db/db_impl/compacted_db_impl.h" #include "db/db_impl/db_impl.h" #include "db/db_iter.h" #include "db/merge_context.h" diff --git a/src.mk b/src.mk index 1e487f4e82..c212ad0588 100644 --- a/src.mk +++ b/src.mk @@ -17,7 +17,6 @@ LIB_SOURCES = \ db/builder.cc \ db/c.cc \ db/column_family.cc \ - db/compacted_db_impl.cc \ db/compaction/compaction.cc \ db/compaction/compaction_iterator.cc \ db/compaction/compaction_job.cc \ @@ -28,6 +27,7 @@ LIB_SOURCES = \ db/compaction/sst_partitioner.cc \ db/convenience.cc \ db/db_filesnapshot.cc \ + db/db_impl/compacted_db_impl.cc \ db/db_impl/db_impl.cc \ db/db_impl/db_impl_compaction_flush.cc \ db/db_impl/db_impl_debug.cc \