| 1460 | |
| 1461 | |
| 1462 | void HierarchicalAllocatorProcess::updateUnavailability( |
| 1463 | const SlaveID& slaveId, |
| 1464 | const Option<Unavailability>& unavailability) |
| 1465 | { |
| 1466 | CHECK(initialized); |
| 1467 | |
| 1468 | Slave& slave = *CHECK_NOTNONE(getSlave(slaveId)); |
| 1469 | |
| 1470 | // NOTE: We currently implement maintenance in the allocator to be able to |
| 1471 | // leverage state and features such as the FrameworkSorter and OfferFilter. |
| 1472 | |
| 1473 | // We explicitly remove all filters for the inverse offers of this slave. We |
| 1474 | // do this because we want to force frameworks to reassess the calculations |
| 1475 | // they have made to respond to the inverse offer. Unavailability of a slave |
| 1476 | // can have a large effect on failure domain calculations and inter-leaved |
| 1477 | // unavailability schedules. |
| 1478 | foreachvalue (Framework& framework, frameworks) { |
| 1479 | framework.inverseOfferFilters.erase(slaveId); |
| 1480 | } |
| 1481 | |
| 1482 | // Remove any old unavailability. |
| 1483 | slave.maintenance = None(); |
| 1484 | |
| 1485 | // If we have a new unavailability. |
| 1486 | if (unavailability.isSome()) { |
| 1487 | slave.maintenance = Slave::Maintenance(unavailability.get()); |
| 1488 | } |
| 1489 | |
| 1490 | generateOffers(slaveId); |
| 1491 | } |
| 1492 | |
| 1493 | |
| 1494 | void HierarchicalAllocatorProcess::updateInverseOffer( |
nothing calls this directly
no test coverage detected