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

Method checkAndCreateMachineTeam

fdbserver/DDTeamCollection.actor.cpp:4838–4854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4836}
4837
4838Reference<TCMachineTeamInfo> DDTeamCollection::checkAndCreateMachineTeam(Reference<TCTeamInfo> serverTeam) {
4839 std::vector<Standalone<StringRef>> machineIDs;
4840 for (auto& server : serverTeam->getServers()) {
4841 Reference<TCMachineInfo> machine = server->machine;
4842 machineIDs.push_back(machine->machineID);
4843 }
4844
4845 std::sort(machineIDs.begin(), machineIDs.end());
4846 Reference<TCMachineTeamInfo> machineTeam = findMachineTeam(machineIDs);
4847 if (!machineTeam.isValid()) { // Create the machine team if it does not exist
4848 machineTeam = addMachineTeam(machineIDs.begin(), machineIDs.end());
4849 }
4850
4851 machineTeam->addServerTeam(serverTeam);
4852
4853 return machineTeam;
4854}
4855
4856void DDTeamCollection::removeMachine(Reference<TCMachineInfo> removedMachineInfo) {
4857 // Find machines that share teams with the removed machine

Callers 1

whenFunction · 0.80

Calls 6

getServersMethod · 0.80
addServerTeamMethod · 0.80
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected