summaryrefslogtreecommitdiff
path: root/src/mongo/s/chunk_version.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/chunk_version.h')
-rw-r--r--src/mongo/s/chunk_version.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/s/chunk_version.h b/src/mongo/s/chunk_version.h
index a0d7f09c1db..a77272d8f03 100644
--- a/src/mongo/s/chunk_version.h
+++ b/src/mongo/s/chunk_version.h
@@ -86,6 +86,16 @@ public:
}
/**
+ * NOTE: This format should not be used. Use fromBSONThrowing instead.
+ *
+ * A throwing version of 'parseLegacyWithField' to resolve a compatibility issue with the
+ * ShardCollectionType IDL type.
+ */
+ static ChunkVersion legacyFromBSONThrowing(const BSONElement& element) {
+ return uassertStatusOK(parseLegacyWithField(element.wrap(), element.fieldNameStringData()));
+ }
+
+ /**
* NOTE: This format is being phased out. Use parseWithField instead.
*
* Parses the BSON formatted by appendLegacyWithField. If the field is missing, returns
@@ -218,6 +228,12 @@ public:
void appendLegacyWithField(BSONObjBuilder* out, StringData field) const;
BSONObj toBSON() const;
+
+ /**
+ * NOTE: This format serializes chunk version as a timestamp (without the epoch) for
+ * legacy reasons.
+ */
+ void legacyToBSON(StringData field, BSONObjBuilder* builder) const;
std::string toString() const;
private: