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

Function getTeamByServers

fdbserver/DDTeamCollection.actor.cpp:159–169  ·  view source on GitHub ↗

Find the team with the exact storage servers as req.src.

Source from the content-addressed store, hash-verified

157
158 // Find the team with the exact storage servers as req.src.
159 static void getTeamByServers(DDTeamCollection* self, GetTeamRequest req) {
160 const std::string servers = TCTeamInfo::serversToString(req.src);
161 Optional<Reference<IDataDistributionTeam>> res;
162 for (const auto& team : self->teams) {
163 if (team->getServerIDsStr() == servers) {
164 res = team;
165 break;
166 }
167 }
168 req.reply.send(std::make_pair(res, false));
169 }
170
171 // SOMEDAY: Make bestTeam better about deciding to leave a shard where it is (e.g. in PRIORITY_TEAM_HEALTHY case)
172 // use keys, src, dest, metrics, priority, system load, etc.. to decide...

Callers 1

Calls 2

getServerIDsStrMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected