summaryrefslogtreecommitdiff
path: root/src/mongo/s/database_version.h
diff options
context:
space:
mode:
authorSergi Mateo Bellido <sergi.mateo-bellido@mongodb.com>2020-12-01 09:52:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-03 08:44:43 +0000
commite77d9a2566cbbc50b5ef67df4dba2445d7205b2d (patch)
tree32306a2f78bc0db2e2e24798eb3f4d21b620f4bb /src/mongo/s/database_version.h
parent446d099a27630521e8b72ae5b0f1f9a8c07a05b6 (diff)
downloadmongo-e77d9a2566cbbc50b5ef67df4dba2445d7205b2d.tar.gz
SERVER-52587 Making collection and database instances comparable through cluster time (no more epochs)
PART 2: Extending the ComparableDatabaseVersion to be able to compare DatabaseVersions with timestamps
Diffstat (limited to 'src/mongo/s/database_version.h')
-rw-r--r--src/mongo/s/database_version.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/s/database_version.h b/src/mongo/s/database_version.h
index adaa1ff3963..82fe6c9bab7 100644
--- a/src/mongo/s/database_version.h
+++ b/src/mongo/s/database_version.h
@@ -46,6 +46,7 @@ namespace mongo {
class DatabaseVersion : private DatabaseVersionBase {
public:
using DatabaseVersionBase::getLastMod;
+ using DatabaseVersionBase::getTimestamp;
using DatabaseVersionBase::toBSON;
// It returns a new DatabaseVersion marked as fixed. A fixed database version is used to
@@ -76,6 +77,9 @@ public:
DatabaseVersion makeUpdated() const;
+ /**
+ * It returns true if the uuid and lastmod of both versions are the same.
+ */
bool operator==(const DatabaseVersion& other) const {
return getUuid() == other.getUuid() && getLastMod() == other.getLastMod();
}