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

Method detect

src/master/detector/zookeeper.cpp:131–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130
131Future<Option<MasterInfo>> ZooKeeperMasterDetectorProcess::detect(
132 const Option<MasterInfo>& previous)
133{
134 // Return immediately if the detector is no longer operational due
135 // to a non-retryable error.
136 if (error.isSome()) {
137 return Failure(error->message);
138 }
139
140 if (leader != previous) {
141 return leader;
142 }
143
144 Promise<Option<MasterInfo>>* promise = new Promise<Option<MasterInfo>>();
145
146 promise->future()
147 .onDiscard(defer(self(), &Self::discard, promise->future()));
148
149 promises.insert(promise);
150 return promise->future();
151}
152
153
154void ZooKeeperMasterDetectorProcess::detected(

Callers 4

initializeMethod · 0.45
detectedMethod · 0.45
initializeMethod · 0.45
detectedMethod · 0.45

Calls 6

FailureClass · 0.85
deferFunction · 0.85
insertMethod · 0.80
dispatchFunction · 0.50
isSomeMethod · 0.45
futureMethod · 0.45

Tested by

no test coverage detected