summaryrefslogtreecommitdiff
path: root/src/mongo/s/chunk_version.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2022-01-20 09:20:51 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-24 14:44:28 +0000
commit3ce4e1938871cfa86599cf37c871542a7f4ca4c4 (patch)
treef659eb8120daa83b8b21ca25ffee25704474b171 /src/mongo/s/chunk_version.h
parent14c6f826f2d54a9d6928009be3627bff948ceb39 (diff)
downloadmongo-3ce4e1938871cfa86599cf37c871542a7f4ca4c4.tar.gz
SERVER-62783 Move the version parsing for ShardCollectionType out of ChunkVersion
Diffstat (limited to 'src/mongo/s/chunk_version.h')
-rw-r--r--src/mongo/s/chunk_version.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/mongo/s/chunk_version.h b/src/mongo/s/chunk_version.h
index 136533ca791..96ea3864b35 100644
--- a/src/mongo/s/chunk_version.h
+++ b/src/mongo/s/chunk_version.h
@@ -93,16 +93,6 @@ 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
@@ -265,14 +255,14 @@ public:
appendWithField(builder, fieldName);
}
- /**
- * 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;
+ // Methods that are here for the purposes of parsing of ShardCollectionType only
+ static ChunkVersion parseMajorMinorVersionOnlyFromShardCollectionType(
+ const BSONElement& element);
+ void serialiseMajorMinorVersionOnlyForShardCollectionType(StringData field,
+ BSONObjBuilder* builder) const;
+
private:
uint64_t _combined;
OID _epoch;