| 83 | } |
| 84 | |
| 85 | int mostUsedZoneCount(Reference<LocalitySet>& logServerSet, std::vector<LocalityEntry>& bestSet) { |
| 86 | AttribKey indexKey = logServerSet->keyIndex("zoneid"); |
| 87 | std::map<AttribValue, int> entries; |
| 88 | for (int i = 0; i < bestSet.size(); i++) { |
| 89 | Optional<AttribValue> value = logServerSet->getRecordViaEntry(bestSet[i])->getValue(indexKey); |
| 90 | entries[value.get()]++; |
| 91 | } |
| 92 | int maxEntries = 0; |
| 93 | for (auto it : entries) { |
| 94 | maxEntries = std::max(maxEntries, it.second); |
| 95 | } |
| 96 | return maxEntries; |
| 97 | } |
| 98 | |
| 99 | bool findBestPolicySetSimple(int targetUniqueValueCount, |
| 100 | Reference<LocalitySet>& logServerSet, |
no test coverage detected