| 33 | namespace { |
| 34 | |
| 35 | std::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 | |
| 50 | std::string lineWrap(const char* text, int col) { |
| 51 | const char* iter = text; |
no test coverage detected