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

Function getCoordinatorsInfoString

fdbcli/StatusCommand.actor.cpp:35–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace {
34
35std::string getCoordinatorsInfoString(StatusObjectReader statusObj) {
36 std::string outputString;
37 try {
38 StatusArray coordinatorsArr = statusObj["client.coordinators.coordinators"].get_array();
39 for (StatusObjectReader coor : coordinatorsArr)
40 outputString += format("\n %s (%s)",
41 coor["address"].get_str().c_str(),
42 coor["reachable"].get_bool() ? "reachable" : "unreachable");
43 } catch (std::runtime_error&) {
44 outputString = "\n Unable to retrieve list of coordination servers";
45 }
46
47 return outputString;
48}
49
50std::string lineWrap(const char* text, int col) {
51 const char* iter = text;

Callers 1

printStatusFunction · 0.85

Calls 3

formatFunction · 0.50
c_strMethod · 0.45
get_boolMethod · 0.45

Tested by

no test coverage detected