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

Method untrackUnderRole

src/master/framework.cpp:728–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726
727
728void Framework::untrackUnderRole(const std::string& role)
729{
730 CHECK(master->isWhitelistedRole(role))
731 << "Unknown role '" << role << "'" << " of framework " << *this;
732
733 CHECK(isTrackedUnderRole(role));
734
735 // NOTE: Ideally we would also `CHECK` that we're not currently subscribed
736 // to the role. We don't do this currently because this function is used in
737 // `Master::removeFramework` where we're still subscribed to `roles`.
738
739 auto allocatedToRole = [&role](const Resource& resource) {
740 return resource.allocation_info().role() == role;
741 };
742
743 CHECK(totalUsedResources.filter(allocatedToRole).empty());
744 CHECK(totalOfferedResources.filter(allocatedToRole).empty());
745
746 master->roles.at(role)->removeFramework(this);
747 if (master->roles.at(role)->frameworks.empty()) {
748 delete master->roles.at(role);
749 master->roles.erase(role);
750 }
751}
752
753
754void Framework::setState(Framework::State _state)

Callers 1

foreachFunction · 0.80

Calls 6

isWhitelistedRoleMethod · 0.80
atMethod · 0.80
emptyMethod · 0.45
filterMethod · 0.45
removeFrameworkMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected