summaryrefslogtreecommitdiff
path: root/src/mongo/rpc/metadata.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-05-01 13:50:20 -0400
committerMathias Stearn <mathias@10gen.com>2017-05-12 12:07:30 -0400
commitefbf9972043c91531ce3d43275cdb8d3beb08dc2 (patch)
tree9b0da64ace926ca7fde0d05483531d45736f5822 /src/mongo/rpc/metadata.h
parentbffbfc21151a8544c9faf9fc2bf97169cbe0bc36 (diff)
downloadmongo-efbf9972043c91531ce3d43275cdb8d3beb08dc2.tar.gz
SERVER-28814 Stop returning Status from metadata functions
Every caller was already using uassertStatusOK. Moving that into the functions simplifies both the implementation and the callers. Also eliminated functions without any callers.
Diffstat (limited to 'src/mongo/rpc/metadata.h')
-rw-r--r--src/mongo/rpc/metadata.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mongo/rpc/metadata.h b/src/mongo/rpc/metadata.h
index 42c10bb3d24..8d3482be458 100644
--- a/src/mongo/rpc/metadata.h
+++ b/src/mongo/rpc/metadata.h
@@ -53,12 +53,7 @@ BSONObj makeEmptyMetadata();
/**
* Reads metadata from a metadata object and sets it on this OperationContext.
*/
-Status readRequestMetadata(OperationContext* opCtx, const BSONObj& metadataObj);
-
-/**
- * Writes metadata from an OperationContext to a metadata object.
- */
-Status writeRequestMetadata(OperationContext* opCtx, BSONObjBuilder* metadataBob);
+void readRequestMetadata(OperationContext* opCtx, const BSONObj& metadataObj);
/**
* A command object and a corresponding metadata object.
@@ -75,13 +70,13 @@ using LegacyCommandAndFlags = std::tuple<BSONObj, int>;
* Given a legacy command object and a query flags bitfield, attempts to parse and remove
* the metadata from the command object and construct a corresponding metadata object.
*/
-StatusWith<CommandAndMetadata> upconvertRequestMetadata(BSONObj legacyCmdObj, int queryFlags);
+CommandAndMetadata upconvertRequestMetadata(BSONObj legacyCmdObj, int queryFlags);
/**
* Given a command object and a metadata object, attempts to construct a legacy command
* object and query flags bitfield augmented with the given metadata.
*/
-StatusWith<LegacyCommandAndFlags> downconvertRequestMetadata(BSONObj cmdObj, BSONObj metadata);
+LegacyCommandAndFlags downconvertRequestMetadata(BSONObj cmdObj, BSONObj metadata);
/**
* A command reply and associated metadata object.
@@ -92,14 +87,7 @@ using CommandReplyWithMetadata = std::tuple<BSONObj, BSONObj>;
* Given a legacy command reply, attempts to strip the metadata from the reply and construct
* a metadata object.
*/
-StatusWith<CommandReplyWithMetadata> upconvertReplyMetadata(const BSONObj& legacyReply);
-
-/**
- * Given a command reply object and an associated metadata object,
- * attempts to construct a legacy command object.
- */
-StatusWith<BSONObj> downconvertReplyMetadata(const BSONObj& commandReply,
- const BSONObj& replyMetadata);
+CommandReplyWithMetadata upconvertReplyMetadata(const BSONObj& legacyReply);
/**
* A function type for writing request metadata. The function takes a pointer to an optional