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

Method updateLocalitySet

fdbserver/LogSystem.cpp:192–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void LogSet::updateLocalitySet(std::vector<LocalityData> const& localities) {
193 LocalityMap<int>* logServerMap;
194
195 logServerSet = Reference<LocalitySet>(new LocalityMap<int>());
196 logServerMap = (LocalityMap<int>*)logServerSet.getPtr();
197
198 logEntryArray.clear();
199 logEntryArray.reserve(localities.size());
200 logIndexArray.clear();
201 logIndexArray.reserve(localities.size());
202
203 for (int i = 0; i < localities.size(); i++) {
204 logIndexArray.push_back(i);
205 logEntryArray.push_back(logServerMap->add(localities[i], &logIndexArray.back()));
206 }
207}
208
209bool LogSet::satisfiesPolicy(const std::vector<LocalityEntry>& locations) {
210 resultEntries.clear();

Callers 4

newEpochMethod · 0.80
LogRouterDataMethod · 0.80

Calls 7

clearMethod · 0.65
getPtrMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
addMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected