MCPcopy Create free account
hub / github.com/apache/impala / GetNode

Method GetNode

be/src/scheduling/hash-ring.cc:91–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91const IpAddr* HashRing::GetNode(uint32_t hash_value) const {
92 if (hash_to_node_.empty()) return nullptr;
93 // Find the element that immediately follows this hash value
94 auto next_elem = hash_to_node_.lower_bound(hash_value);
95 if (next_elem == hash_to_node_.end()) {
96 // This is larger than the largest elem. Return the smallest elem
97 next_elem = hash_to_node_.begin();
98 }
99 NodeIterator node_it = next_elem->second;
100 return &(*node_it);
101}
102
103void HashRing::GetDistributionMap(
104 map<IpAddr, uint64_t>* distribution_map) const {

Callers 5

TEST_FFunction · 0.80

Calls 3

emptyMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by 1

TEST_FFunction · 0.64