| 11317 | |
| 11318 | |
| 11319 | void Master::removeExecutor( |
| 11320 | Slave* slave, |
| 11321 | const FrameworkID& frameworkId, |
| 11322 | const ExecutorID& executorId) |
| 11323 | { |
| 11324 | CHECK_NOTNULL(slave); |
| 11325 | CHECK(slave->hasExecutor(frameworkId, executorId)); |
| 11326 | |
| 11327 | ExecutorInfo executor = slave->executors[frameworkId][executorId]; |
| 11328 | |
| 11329 | // Note that we explicitly convert from protobuf to `Resources` here |
| 11330 | // and then use the result below to avoid performance penalty for multiple |
| 11331 | // conversions and validations implied by conversion. |
| 11332 | // Conversion is safe, as resources have already passed validation. |
| 11333 | const Resources resources = executor.resources(); |
| 11334 | |
| 11335 | LOG(INFO) << "Removing executor '" << executorId |
| 11336 | << "' with resources " << resources |
| 11337 | << " of framework " << frameworkId << " on agent " << *slave; |
| 11338 | |
| 11339 | allocator->recoverResources(frameworkId, slave->id, resources, None(), true); |
| 11340 | |
| 11341 | Framework* framework = getFramework(frameworkId); |
| 11342 | if (framework != nullptr) { // The framework might not be reregistered yet. |
| 11343 | framework->removeExecutor(slave->id, executorId); |
| 11344 | } |
| 11345 | |
| 11346 | slave->removeExecutor(frameworkId, executorId); |
| 11347 | } |
| 11348 | |
| 11349 | |
| 11350 | void Master::addOperation( |
nothing calls this directly
no test coverage detected