| 3741 | } |
| 3742 | |
| 3743 | bool DDTeamCollection::isValidLocality(Reference<IReplicationPolicy> storagePolicy, |
| 3744 | const LocalityData& locality) const { |
| 3745 | // Future: Once we add simulation test that misconfigure a cluster, such as not setting some locality entries, |
| 3746 | // DD_VALIDATE_LOCALITY should always be true. Otherwise, simulation test may fail. |
| 3747 | if (!SERVER_KNOBS->DD_VALIDATE_LOCALITY) { |
| 3748 | // Disable the checking if locality is valid |
| 3749 | return true; |
| 3750 | } |
| 3751 | |
| 3752 | std::set<std::string> replicationPolicyKeys = storagePolicy->attributeKeys(); |
| 3753 | for (auto& policy : replicationPolicyKeys) { |
| 3754 | if (!locality.isPresent(policy)) { |
| 3755 | return false; |
| 3756 | } |
| 3757 | } |
| 3758 | |
| 3759 | return true; |
| 3760 | } |
| 3761 | |
| 3762 | void DDTeamCollection::evaluateTeamQuality() const { |
| 3763 | int teamCount = teams.size(), serverCount = allServers.size(); |
no test coverage detected