summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context.h
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2019-01-25 15:37:25 -0500
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2019-01-28 18:22:31 -0500
commitd0b2a623ee1838ba060713d0ff9bd1ba94d9e7d8 (patch)
tree4353289df98ac4c5d0fe46418c4aca9ffd31fe2d /src/mongo/db/operation_context.h
parente990d25622d96897d78e72b362db61f2a4f9d99c (diff)
downloadmongo-d0b2a623ee1838ba060713d0ff9bd1ba94d9e7d8.tar.gz
SERVER-38813 Replace AlternativeOpCtx with AlternativeClientRegion
Diffstat (limited to 'src/mongo/db/operation_context.h')
-rw-r--r--src/mongo/db/operation_context.h29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/mongo/db/operation_context.h b/src/mongo/db/operation_context.h
index df8694b0e05..e1ea8e6d61d 100644
--- a/src/mongo/db/operation_context.h
+++ b/src/mongo/db/operation_context.h
@@ -468,35 +468,6 @@ private:
bool _writesAreReplicated = true;
};
-/**
- * RAII-style class to temporarily swap the operation context associated with the client.
- *
- * Use this class to bind a new operation context to a client for the duration of the
- * AlternativeOpCtx's lifetime and restore the prior opCtx at the end of the block.
- */
-class AlternativeOpCtx {
-public:
- explicit AlternativeOpCtx(mongo::OperationContext* originalOpCtx)
- : _client(originalOpCtx->getClient()), _originalOpCtx(originalOpCtx) {
- _client->resetOperationContext();
- _alternateOpCtx = _client->makeOperationContext();
- }
-
- ~AlternativeOpCtx() {
- _alternateOpCtx.reset();
- _client->setOperationContext(_originalOpCtx);
- }
-
- mongo::OperationContext* getOperationContext() {
- return _alternateOpCtx.get();
- }
-
-private:
- Client* _client = nullptr;
- mongo::OperationContext* _originalOpCtx = nullptr;
- ServiceContext::UniqueOperationContext _alternateOpCtx;
-};
-
namespace repl {
/**
* RAII-style class to turn off replicated writes. Writes do not create oplog entries while the