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

Function TEST_F

be/src/scheduling/hash-ring-test.cc:103–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101};
102
103TEST_F(HashRingTest, BasicAddRemove) {
104 vector<IpAddr> basic_addresses;
105 GetBasicNetworkAddresses(basic_addresses);
106
107 const uint32_t replication = 10;
108 HashRing h(replication);
109 VerifyCounts(h, 0);
110
111 int total_addresses = basic_addresses.size();
112 for (int i = 0; i < total_addresses; i++) {
113 h.AddNode(basic_addresses[i]);
114 VerifyCounts(h, i + 1);
115 }
116
117 // Remove the elements in a different order
118 std::random_shuffle(basic_addresses.begin(), basic_addresses.end());
119 for (int i = 0; i < total_addresses; i++) {
120 h.RemoveNode(basic_addresses[i]);
121 VerifyCounts(h, total_addresses - (i + 1));
122 }
123}
124
125TEST_F(HashRingTest, GetNode) {
126 vector<IpAddr> basic_addresses;

Callers

nothing calls this directly

Calls 9

timeFunction · 0.85
AddNodeMethod · 0.80
RemoveNodeMethod · 0.80
GetNodeMethod · 0.80
resetMethod · 0.65
findFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected