diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2015-09-23 22:36:21 -0400 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2015-09-25 17:30:33 -0400 |
commit | 18de2f3d6bb4c01fb600bbb0e3a2c2e4ab0cc9ee (patch) | |
tree | 746011a289a10486090780e3ca0810919bbeba5b /src/mongo/db/repl/optime.cpp | |
parent | 4980f0d20ed494da2862c337cd2dc1fc7a5dd422 (diff) | |
download | mongo-18de2f3d6bb4c01fb600bbb0e3a2c2e4ab0cc9ee.tar.gz |
SERVER-20326: record apply batch boundaries
Diffstat (limited to 'src/mongo/db/repl/optime.cpp')
-rw-r--r-- | src/mongo/db/repl/optime.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/repl/optime.cpp b/src/mongo/db/repl/optime.cpp index 92a3c5556ca..53474c9ba60 100644 --- a/src/mongo/db/repl/optime.cpp +++ b/src/mongo/db/repl/optime.cpp @@ -82,6 +82,13 @@ StatusWith<OpTime> OpTime::parseFromOplogEntry(const BSONObj& obj) { return OpTime(ts, term); } +BSONObj OpTime::toBSON() const { + BSONObjBuilder bldr; + bldr.append(kTimestampFieldName, _timestamp); + bldr.append(kTermFieldName, _term); + return bldr.obj(); +} + std::string OpTime::toString() const { std::stringstream ss; ss << "(term: " << _term << ", timestamp: " << _timestamp.toStringPretty() << ")"; |