Returns the list of IPAddresses of the workers that match the given locality. Example: locality="dcid:primary" returns all the ip addresses of the workers in the primary dc.
| 1750 | // Returns the list of IPAddresses of the workers that match the given locality. |
| 1751 | // Example: locality="dcid:primary" returns all the ip addresses of the workers in the primary dc. |
| 1752 | std::set<AddressExclusion> getAddressesByLocality(const std::vector<ProcessData>& workers, |
| 1753 | const std::string& locality) { |
| 1754 | std::pair<std::string, std::string> localityKeyValue = decodeLocality(locality); |
| 1755 | |
| 1756 | std::set<AddressExclusion> localityAddresses; |
| 1757 | for (int i = 0; i < workers.size(); i++) { |
| 1758 | if (workers[i].locality.isPresent(localityKeyValue.first) && |
| 1759 | workers[i].locality.get(localityKeyValue.first) == localityKeyValue.second) { |
| 1760 | localityAddresses.insert(AddressExclusion(workers[i].address.ip, workers[i].address.port)); |
| 1761 | } |
| 1762 | } |
| 1763 | |
| 1764 | return localityAddresses; |
| 1765 | } |
| 1766 | |
| 1767 | ACTOR Future<Void> printHealthyZone(Database cx) { |
| 1768 | state Transaction tr(cx); |