MCPcopy Create free account
hub / github.com/apple/foundationdb / getDRMutationStreamId

Function getDRMutationStreamId

fdbclient/DatabaseBackupAgent.actor.cpp:2345–2365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2343}
2344
2345std::string getDRMutationStreamId(StatusObjectReader statusObj, const char* context, Key tagName) {
2346 try {
2347 StatusObjectReader statusObjLayers;
2348 statusObj.get("cluster.layers", statusObjLayers);
2349 StatusObjectReader tags;
2350 std::string path = format("%s.tags", context);
2351 if (statusObjLayers.tryGet(path, tags)) {
2352 for (auto itr : tags.obj()) {
2353 if (itr.first == tagName.toString()) {
2354 JSONDoc tag(itr.second);
2355 return tag["mutation_stream_id"].get_str();
2356 }
2357 }
2358 }
2359 TraceEvent(SevWarn, "DBA_TagNotPresentInStatus").detail("Tag", tagName).detail("Context", context);
2360 throw backup_error();
2361 } catch (std::runtime_error& e) {
2362 TraceEvent(SevWarn, "DBA_GetDRMutationStreamIdFail").detail("Error", e.what());
2363 throw backup_error();
2364 }
2365}
2366
2367bool getLockedStatus(StatusObjectReader statusObj) {
2368 try {

Callers 1

Calls 7

TraceEventClass · 0.85
detailMethod · 0.80
getMethod · 0.65
formatFunction · 0.50
tryGetMethod · 0.45
toStringMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected