[CXX-658] question about optime,timestamp and log Created: 28/Aug/15  Updated: 11/Sep/19  Resolved: 17/Sep/15

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: legacy-1.0.5
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: nosqldb Assignee: Unassigned
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,
1.I noticed that BSONElement had the _opTime() method in the early version to get an OpTime type from BSONElement type (e.g. "ts" field in oplog), and now only timestamp() ,and Timestamp_t object could't change value.
private:
const uint32_t _seconds;
const uint32_t _increment;

2. the log util seems unable to use ?Could I use LOG() or Log() or something.

thanks.



 Comments   
Comment by Adam Midvidy [ 28/Aug/15 ]

Hi inosql!

For your first question, the original OpTime class was removed as its implementation was non-portable. We replaced it with Timestamp_t, which is simpler. Instead of mutating the Timestamp_t, you can just construct a new one with the desired value. Since the class is so trivial (a struct with 2 integers), the cost of doing this should be almost nothing.

For your second question - we namespace the driver macros with MONGO_*, so the LOG macro is now MONGO_LOG in the legacy driver.

Hope this helps - let me know if you have any further questions.

Adam

Generated at Wed Feb 07 21:59:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.