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

Method _failoverFramework

src/master/master.cpp:10319–10355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10317
10318
10319void Master::_failoverFramework(Framework* framework)
10320{
10321 // Discard the framework's offers, if they weren't removed before.
10322 foreach (Offer* offer, utils::copy(framework->offers)) {
10323 discardOffer(offer);
10324 }
10325
10326 // Also remove the inverse offers.
10327 foreach (InverseOffer* inverseOffer, utils::copy(framework->inverseOffers)) {
10328 allocator->updateInverseOffer(
10329 inverseOffer->slave_id(),
10330 inverseOffer->framework_id(),
10331 UnavailableResources{
10332 inverseOffer->resources(),
10333 inverseOffer->unavailability()},
10334 None());
10335
10336 removeInverseOffer(inverseOffer);
10337 }
10338
10339 CHECK(!framework->recovered());
10340
10341 if (framework->activate()) {
10342 // The framework was inactive and needs to be activated in the allocator.
10343 //
10344 // NOTE: We do this after recovering resources (above) so that
10345 // the allocator has the correct view of the framework's share.
10346 allocator->activateFramework(framework->id());
10347 }
10348
10349 // The scheduler driver safely ignores any duplicate registration
10350 // messages, so we don't need to compare the old and new pids here.
10351 FrameworkRegisteredMessage message;
10352 message.mutable_framework_id()->MergeFrom(framework->id());
10353 message.mutable_master_info()->MergeFrom(info_);
10354 framework->send(message);
10355}
10356
10357
10358void Master::teardown(Framework* framework)

Callers

nothing calls this directly

Calls 11

copyFunction · 0.85
NoneClass · 0.85
recoveredMethod · 0.80
MergeFromMethod · 0.80
foreachFunction · 0.70
sendMethod · 0.65
updateInverseOfferMethod · 0.45
resourcesMethod · 0.45
activateMethod · 0.45
activateFrameworkMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected