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

Method getShardsFor

fdbserver/ShardsAffectedByTeamFailure.cpp:23–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include "fdbserver/ShardsAffectedByTeamFailure.h"
22
23std::vector<KeyRange> ShardsAffectedByTeamFailure::getShardsFor(Team team) const {
24 std::vector<KeyRange> r;
25 for (auto it = team_shards.lower_bound(std::pair<Team, KeyRange>(team, KeyRangeRef()));
26 it != team_shards.end() && it->first == team;
27 ++it)
28 r.push_back(it->second);
29 return r;
30}
31
32bool ShardsAffectedByTeamFailure::hasShards(Team team) const {
33 auto it = team_shards.lower_bound(std::pair<Team, KeyRange>(team, KeyRangeRef()));

Calls 4

KeyRangeRefClass · 0.50
lower_boundMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected