From b810e62b396729b553ae4990f47eed6013b47c23 Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Tue, 28 Apr 2020 15:23:33 -0700 Subject: [PATCH] Clarifying comments in db.h (#6768) Summary: And fix a confusingly worded log message Pull Request resolved: https://github.com/facebook/rocksdb/pull/6768 Reviewed By: anand1976 Differential Revision: D21284527 Pulled By: pdillinger fbshipit-source-id: f03c1422c229a901c3a65e524740452349626164 --- db/compaction/compaction_picker_universal.cc | 2 +- include/rocksdb/db.h | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/db/compaction/compaction_picker_universal.cc b/db/compaction/compaction_picker_universal.cc index afdcf7acf..fe2d8e49b 100644 --- a/db/compaction/compaction_picker_universal.cc +++ b/db/compaction/compaction_picker_universal.cc @@ -389,7 +389,7 @@ Compaction* UniversalCompactionBuilder::PickCompaction() { VersionStorageInfo::LevelSummaryStorage tmp; ROCKS_LOG_BUFFER_MAX_SZ( log_buffer_, 3072, - "[%s] Universal: sorted runs files(%" ROCKSDB_PRIszt "): %s\n", + "[%s] Universal: sorted runs: %" ROCKSDB_PRIszt " files: %s\n", cf_name_.c_str(), sorted_runs_.size(), vstorage_->LevelSummary(&tmp)); Compaction* c = nullptr; diff --git a/include/rocksdb/db.h b/include/rocksdb/db.h index 6de90fa0b..de35c1290 100644 --- a/include/rocksdb/db.h +++ b/include/rocksdb/db.h @@ -127,9 +127,11 @@ struct GetMergeOperandsOptions { typedef std::unordered_map> TablePropertiesCollection; -// A DB is a persistent ordered map from keys to values. +// A DB is a persistent, versioned ordered map from keys to values. // A DB is safe for concurrent access from multiple threads without // any external synchronization. +// DB is an abstract base class with one primary implementation (DBImpl) +// and a number of wrapper implementations. class DB { public: // Open the database with the specified "name". @@ -255,6 +257,7 @@ class DB { const std::string& name, std::vector* column_families); + // Abstract class ctor DB() {} // No copying allowed DB(const DB&) = delete; @@ -457,6 +460,11 @@ class DB { GetMergeOperandsOptions* get_merge_operands_options, int* number_of_operands) = 0; + // Consistent Get of many keys across column families without the need + // for an explicit snapshot. NOTE: the implementation of this MultiGet API + // does not have the performance benefits of the void-returning MultiGet + // functions. + // // If keys[i] does not exist in the database, then the i'th returned // status will be one for which Status::IsNotFound() is true, and // (*values)[i] will be set to some arbitrary value (often ""). Otherwise, @@ -1139,7 +1147,8 @@ class DB { // This function will wait until all currently running background processes // finish. After it returns, no background process will be run until - // ContinueBackgroundWork is called + // ContinueBackgroundWork is called, once for each preceding OK-returning + // call to PauseBackgroundWork. virtual Status PauseBackgroundWork() = 0; virtual Status ContinueBackgroundWork() = 0;