MCPcopy Create free account
hub / github.com/apache/mesos / detected

Method detected

src/master/detector/zookeeper.cpp:154–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153
154void ZooKeeperMasterDetectorProcess::detected(
155 const Future<Option<Group::Membership>>& _leader)
156{
157 CHECK(!_leader.isDiscarded());
158
159 if (_leader.isFailed()) {
160 LOG(ERROR) << "Failed to detect the leader: " << _leader.failure();
161
162 // Setting this error stops the detection loop and the detector
163 // transitions to an erroneous state. Further calls to detect()
164 // will directly fail as a result.
165 error = Error(_leader.failure());
166 leader = None();
167
168 failPromises(&promises, _leader.failure());
169
170 return;
171 }
172
173 if (_leader->isNone()) {
174 leader = None();
175
176 setPromises(&promises, leader);
177 } else {
178 // Fetch the data associated with the leader.
179 group->data(_leader->get())
180 .onAny(defer(self(), &Self::fetched, _leader->get(), lambda::_1));
181 }
182
183 // Keep trying to detect leadership changes.
184 detector.detect(_leader.get())
185 .onAny(defer(self(), &Self::detected, lambda::_1));
186}
187
188
189void ZooKeeperMasterDetectorProcess::fetched(

Callers

nothing calls this directly

Calls 12

NoneClass · 0.85
failPromisesFunction · 0.85
setPromisesFunction · 0.85
deferFunction · 0.85
isDiscardedMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
dataMethod · 0.80
ErrorFunction · 0.50
isNoneMethod · 0.45
getMethod · 0.45
detectMethod · 0.45

Tested by

no test coverage detected