From 188fcbc3bf1ad7ff7f8114c33412fd9e27295c79 Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Wed, 7 Mar 2018 14:15:54 -0500 Subject: SERVER-33725 use OplogEntry to parse opType in SyncTail::syncApply --- src/mongo/db/repl/oplog_entry.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/repl/oplog_entry.cpp') 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) { -- cgit v1.2.1