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

Method received

src/examples/long_lived_framework.cpp:193–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 }
192
193 void received(queue<Event> events)
194 {
195 while (!events.empty()) {
196 Event event = events.front();
197 events.pop();
198
199 LOG(INFO) << "Received " << event.type() << " event";
200
201 switch (event.type()) {
202 case Event::SUBSCRIBED: {
203 framework.mutable_id()->CopyFrom(event.subscribed().framework_id());
204
205 LOG(INFO) << "Subscribed with ID '" << framework.id() << "'";
206
207 state = SUBSCRIBED;
208 break;
209 }
210
211 case Event::OFFERS: {
212 offers(google::protobuf::convert(event.offers().offers()));
213 break;
214 }
215
216 case Event::UPDATE: {
217 update(event.update().status());
218 break;
219 }
220
221 // TODO(greggomann): Implement handling of operation status updates.
222 case Event::UPDATE_OPERATION_STATUS:
223 break;
224
225 case Event::FAILURE: {
226 const Event::Failure& failure = event.failure();
227
228 if (failure.has_agent_id() && failure.has_executor_id()) {
229 executorFailed(
230 failure.executor_id(),
231 failure.agent_id(),
232 failure.has_status() ? Option<int>(failure.status()) : None());
233 } else {
234 CHECK(failure.has_agent_id());
235
236 agentFailed(failure.agent_id());
237 }
238 break;
239 }
240
241 case Event::ERROR: {
242 EXIT(EXIT_FAILURE) << "Error: " << event.error().message();
243 break;
244 }
245
246 case Event::HEARTBEAT:
247 case Event::INVERSE_OFFERS:
248 case Event::RESCIND:
249 case Event::RESCIND_INVERSE_OFFER:
250 case Event::MESSAGE: {

Callers

nothing calls this directly

Calls 14

NoneClass · 0.85
typeMethod · 0.80
CopyFromMethod · 0.80
subscribedMethod · 0.80
failureMethod · 0.80
errorMethod · 0.65
convertFunction · 0.50
updateFunction · 0.50
emptyMethod · 0.45
idMethod · 0.45
offersMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected