summaryrefslogtreecommitdiff
path: root/src/mongo/embedded/read_concern_embedded.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-11-07 15:22:08 +0000
committerevergreen <evergreen@mongodb.com>2019-11-07 15:22:08 +0000
commitb2493375543cb89b020f224a1759c1f4d40aa638 (patch)
tree971629049003126366f31846208ce6bf65fdbd20 /src/mongo/embedded/read_concern_embedded.cpp
parenta811bbe9d2489c428886288651c2dbddec0d123d (diff)
downloadmongo-b2493375543cb89b020f224a1759c1f4d40aa638.tar.gz
SERVER-44372 WeakFunction: a simplification of SHIM_ macros
Diffstat (limited to 'src/mongo/embedded/read_concern_embedded.cpp')
-rw-r--r--src/mongo/embedded/read_concern_embedded.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/mongo/embedded/read_concern_embedded.cpp b/src/mongo/embedded/read_concern_embedded.cpp
index dde836dca47..d6fc2a0cbe7 100644
--- a/src/mongo/embedded/read_concern_embedded.cpp
+++ b/src/mongo/embedded/read_concern_embedded.cpp
@@ -27,21 +27,22 @@
* it in the license file.
*/
+#include "mongo/base/shim.h"
#include "mongo/db/read_concern.h"
#include "mongo/db/repl/read_concern_args.h"
#include "mongo/db/repl/speculative_majority_read_info.h"
namespace mongo {
+namespace {
-MONGO_REGISTER_SHIM(setPrepareConflictBehaviorForReadConcern)
-(OperationContext* opCtx,
- const repl::ReadConcernArgs& readConcernArgs,
- PrepareConflictBehavior requestedPrepareConflictBehavior)
- ->void {}
+void setPrepareConflictBehaviorForReadConcernImpl(
+ OperationContext* opCtx,
+ const repl::ReadConcernArgs& readConcernArgs,
+ PrepareConflictBehavior requestedPrepareConflictBehavior) {}
-MONGO_REGISTER_SHIM(waitForReadConcern)
-(OperationContext* opCtx, const repl::ReadConcernArgs& readConcernArgs, bool allowAfterClusterTime)
- ->Status {
+Status waitForReadConcernImpl(OperationContext* opCtx,
+ const repl::ReadConcernArgs& readConcernArgs,
+ bool allowAfterClusterTime) {
if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kLinearizableReadConcern) {
return {ErrorCodes::NotImplemented, "linearizable read concern not supported on embedded"};
} else if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern) {
@@ -56,14 +57,24 @@ MONGO_REGISTER_SHIM(waitForReadConcern)
return Status::OK();
}
-MONGO_REGISTER_SHIM(waitForSpeculativeMajorityReadConcern)
-(OperationContext* opCtx, repl::SpeculativeMajorityReadInfo speculativeReadInfo)->Status {
+
+Status waitForSpeculativeMajorityReadConcernImpl(
+ OperationContext* opCtx, repl::SpeculativeMajorityReadInfo speculativeReadInfo) {
return Status::OK();
}
-MONGO_REGISTER_SHIM(waitForLinearizableReadConcern)
-(OperationContext* opCtx, const int readConcernTimeout)->Status {
+Status waitForLinearizableReadConcernImpl(OperationContext* opCtx, int readConcernTimeout) {
return Status::OK();
}
+auto setPrepareConflictBehaviorForReadConcernRegistration = MONGO_WEAK_FUNCTION_REGISTRATION(
+ setPrepareConflictBehaviorForReadConcern, setPrepareConflictBehaviorForReadConcernImpl);
+auto waitForReadConcernRegistration =
+ MONGO_WEAK_FUNCTION_REGISTRATION(waitForReadConcern, waitForReadConcernImpl);
+auto waitForSpeculativeMajorityReadConcernRegistration = MONGO_WEAK_FUNCTION_REGISTRATION(
+ waitForSpeculativeMajorityReadConcern, waitForSpeculativeMajorityReadConcernImpl);
+auto waitForLinearizableReadConcernRegistration = MONGO_WEAK_FUNCTION_REGISTRATION(
+ waitForLinearizableReadConcern, waitForLinearizableReadConcernImpl);
+
+} // namespace
} // namespace mongo