Skip to content

Commit

Permalink
Clarifying comments in db.h (#6768)
Browse files Browse the repository at this point in the history
Summary:
And fix a confusingly worded log message
Pull Request resolved: #6768

Reviewed By: anand1976

Differential Revision: D21284527

Pulled By: pdillinger

fbshipit-source-id: f03c1422c229a901c3a65e524740452349626164
  • Loading branch information
pdillinger authored and facebook-github-bot committed Apr 28, 2020
1 parent bae6f58 commit b810e62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion db/compaction/compaction_picker_universal.cc
Expand Up @@ -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;
Expand Down
13 changes: 11 additions & 2 deletions include/rocksdb/db.h
Expand Up @@ -127,9 +127,11 @@ struct GetMergeOperandsOptions {
typedef std::unordered_map<std::string, std::shared_ptr<const TableProperties>>
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".
Expand Down Expand Up @@ -255,6 +257,7 @@ class DB {
const std::string& name,
std::vector<std::string>* column_families);

// Abstract class ctor
DB() {}
// No copying allowed
DB(const DB&) = delete;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit b810e62

Please sign in to comment.