bool KVCollectionCatalogEntry::isEqualToMetadataUUID(OperationContext* opCtx, OptionalCollectionUUID uuid) { MetaData md = _getMetaData(opCtx); if (uuid) { return md.options.uuid && md.options.uuid.get() == uuid.get(); } else { return !md.options.uuid; } }
std::pair<BSONObj, RecordId> RollbackTest::makeCommandOp(Timestamp ts, OptionalCollectionUUID uuid, StringData nss, BSONObj cmdObj, int recordId, boost::optional<BSONObj> o2) { BSONObjBuilder bob; bob.append("ts", ts); bob.append("op", "c"); if (uuid) { // Not all ops have UUID fields. uuid.get().appendToBuilder(&bob, "ui"); } bob.append("ns", nss); bob.append("o", cmdObj); if (o2) { bob.append("o2", *o2); } return std::make_pair(bob.obj(), RecordId(recordId)); }