| 2343 | } |
| 2344 | |
| 2345 | std::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 | |
| 2367 | bool getLockedStatus(StatusObjectReader statusObj) { |
| 2368 | try { |
no test coverage detected