diff options
author | Benety Goh <benety@mongodb.com> | 2018-03-07 14:15:54 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-03-07 14:22:46 -0500 |
commit | 188fcbc3bf1ad7ff7f8114c33412fd9e27295c79 (patch) | |
tree | 09821ce9b9fedd1a4358dff16c34306b70ed15ce /src/mongo/db/repl/oplog_entry.cpp | |
parent | 083647f38662195653b87b6a79ae1183d269f910 (diff) | |
download | mongo-188fcbc3bf1ad7ff7f8114c33412fd9e27295c79.tar.gz |
SERVER-33725 use OplogEntry to parse opType in SyncTail::syncApply
Diffstat (limited to 'src/mongo/db/repl/oplog_entry.cpp')
-rw-r--r-- | src/mongo/db/repl/oplog_entry.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/repl/oplog_entry.cpp b/src/mongo/db/repl/oplog_entry.cpp index 45fafaf06e8..722ed0e596c 100644 --- a/src/mongo/db/repl/oplog_entry.cpp +++ b/src/mongo/db/repl/oplog_entry.cpp @@ -227,8 +227,9 @@ bool OplogEntry::isCommand() const { return getOpType() == OpTypeEnum::kCommand; } -bool OplogEntry::isCrudOpType() const { - switch (getOpType()) { +// static +bool OplogEntry::isCrudOpType(OpTypeEnum opType) { + switch (opType) { case OpTypeEnum::kInsert: case OpTypeEnum::kDelete: case OpTypeEnum::kUpdate: @@ -240,6 +241,10 @@ bool OplogEntry::isCrudOpType() const { MONGO_UNREACHABLE; } +bool OplogEntry::isCrudOpType() const { + return isCrudOpType(getOpType()); +} + BSONElement OplogEntry::getIdElement() const { invariant(isCrudOpType()); if (getOpType() == OpTypeEnum::kUpdate) { |