| 726 | |
| 727 | |
| 728 | void 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 | |
| 754 | void Framework::setState(Framework::State _state) |
no test coverage detected