From f1302ebab8c39ba441a33e73b8e37d75d53efa22 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Thu, 30 May 2019 16:09:45 -0700 Subject: [PATCH] Add class-level comments to version-related classes (#5348) Summary: As title. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5348 Differential Revision: D15564595 Pulled By: riversand963 fbshipit-source-id: dd45aa86a70e0343c2e9ef702fad165163f548e6 --- db/version_set.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/db/version_set.h b/db/version_set.h index 28ad0c2c2..776e08e44 100644 --- a/db/version_set.h +++ b/db/version_set.h @@ -91,6 +91,9 @@ extern void DoGenerateLevelFilesBrief(LevelFilesBrief* file_level, const std::vector& files, Arena* arena); +// Information of the storage associated with each Version, including number of +// levels of LSM tree, files information at each level, files marked for +// compaction, etc. class VersionStorageInfo { public: VersionStorageInfo(const InternalKeyComparator* internal_comparator, @@ -537,6 +540,8 @@ class VersionStorageInfo { }; using MultiGetRange = MultiGetContext::Range; +// A column family's version consists of the SST files owned by the column +// family at a certain point in time. class Version { public: // Append to *iters a sequence of iterators that will @@ -747,6 +752,9 @@ struct ObsoleteFileInfo { class BaseReferencedVersionBuilder; +// VersionSet is the collection of versions of all the column families of the +// database. Each database owns one VersionSet. A VersionSet has access to all +// column families via ColumnFamilySet, i.e. set of the column families. class VersionSet { public: VersionSet(const std::string& dbname, const ImmutableDBOptions* db_options, @@ -1103,6 +1111,10 @@ class VersionSet { VersionEdit* edit, InstrumentedMutex* mu); }; +// ReactiveVersionSet represents a collection of versions of the column +// families of the database. Users of ReactiveVersionSet, e.g. DBImplSecondary, +// need to replay the MANIFEST (description log in older terms) in order to +// reconstruct and install versions. class ReactiveVersionSet : public VersionSet { public: ReactiveVersionSet(const std::string& dbname,