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

Method checkAndCreateMachine

fdbserver/DDTeamCollection.actor.cpp:4816–4836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4814}
4815
4816Reference<TCMachineInfo> DDTeamCollection::checkAndCreateMachine(Reference<TCServerInfo> server) {
4817 ASSERT(server.isValid() && server_info.find(server->getId()) != server_info.end());
4818 auto const& locality = server->getLastKnownInterface().locality;
4819 Standalone<StringRef> machine_id = locality.zoneId().get(); // locality to machine_id with std::string type
4820
4821 Reference<TCMachineInfo> machineInfo;
4822 if (machine_info.find(machine_id) == machine_info.end()) {
4823 // uid is the first storage server process on the machine
4824 CODE_PROBE(true, "First storage server in process on the machine");
4825 // For each machine, store the first server's localityEntry into machineInfo for later use.
4826 LocalityEntry localityEntry = machineLocalityMap.add(locality, &server->getId());
4827 machineInfo = makeReference<TCMachineInfo>(server, localityEntry);
4828 machine_info.insert(std::make_pair(machine_id, machineInfo));
4829 } else {
4830 machineInfo = machine_info.find(machine_id)->second;
4831 machineInfo->serversOnMachine.push_back(server);
4832 }
4833 server->machine = machineInfo;
4834
4835 return machineInfo;
4836}
4837
4838Reference<TCMachineTeamInfo> DDTeamCollection::checkAndCreateMachineTeam(Reference<TCTeamInfo> serverTeam) {
4839 std::vector<Standalone<StringRef>> machineIDs;

Callers 2

whenFunction · 0.80
testTeamCollectionMethod · 0.80

Calls 9

zoneIdMethod · 0.80
getMethod · 0.65
isValidMethod · 0.45
findMethod · 0.45
getIdMethod · 0.45
endMethod · 0.45
addMethod · 0.45
insertMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected