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

Method updateUnavailability

src/master/allocator/mesos/hierarchical.cpp:1462–1491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1460
1461
1462void 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
1494void HierarchicalAllocatorProcess::updateInverseOffer(

Callers

nothing calls this directly

Calls 5

getSlaveFunction · 0.85
NoneClass · 0.85
MaintenanceClass · 0.70
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected