MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / ExtMsgUpdate

Method ExtMsgUpdate

src/ExtMsg.actor.cpp:917–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

915}
916
917ExtMsgUpdate::ExtMsgUpdate(ExtMsgHeader* header, const uint8_t* body) : header(header) {
918 const uint8_t* ptr = body;
919 const uint8_t* eom = (const uint8_t*)header + header->messageLength;
920
921 ptr += sizeof(int32_t); // mongo OP_UPDATE begins with int32 ZERO, reserved for future use
922
923 const char* collName = (const char*)ptr;
924 ptr += strlen(collName) + 1;
925 ns = getDBCollectionPair(collName, std::make_pair("msgType", "OP_UPDATE"));
926
927 flags = *(int32_t*)ptr;
928 ptr += sizeof(int32_t);
929
930 upsert = ((flags & Flags::UPSERT) == Flags::UPSERT);
931 multi = ((flags & Flags::MULTI) == Flags::MULTI);
932
933 selector = bson::BSONObj((const char*)ptr);
934 ptr += selector.objsize();
935 update = bson::BSONObj((const char*)ptr);
936 ptr += update.objsize();
937
938 ASSERT(ptr == eom);
939}
940
941std::string ExtMsgUpdate::toString() {
942 return format("UPDATE: selector=%s, update=%s, collection=%s, flags=%d (%s)", selector.toString().c_str(),

Callers

nothing calls this directly

Calls 1

getDBCollectionPairFunction · 0.85

Tested by

no test coverage detected