| 11348 | |
| 11349 | |
| 11350 | void Master::addOperation( |
| 11351 | Framework* framework, |
| 11352 | Slave* slave, |
| 11353 | Operation* operation) |
| 11354 | { |
| 11355 | CHECK_NOTNULL(operation); |
| 11356 | CHECK_NOTNULL(slave); |
| 11357 | |
| 11358 | metrics->incrementOperationState( |
| 11359 | operation->info().type(), operation->latest_status().state()); |
| 11360 | |
| 11361 | slave->addOperation(operation); |
| 11362 | |
| 11363 | if (framework != nullptr) { |
| 11364 | framework->addOperation(operation); |
| 11365 | } else { |
| 11366 | // When the framework is not known by the master, this means either: |
| 11367 | // * The framework has been completed. |
| 11368 | // * The framework has no known tasks and has yet to reregister. |
| 11369 | // The master cannot always differentiate these cases, because completed |
| 11370 | // frameworks are only kept in memory, in a circular buffer. |
| 11371 | // |
| 11372 | // TODO(josephw): Once MESOS-8582 is resolved, operations may include |
| 11373 | // enough information to add a framework entry, which means only |
| 11374 | // completed frameworks would result in orphans. |
| 11375 | // |
| 11376 | // These operations will be preemptively considered "orphans" and |
| 11377 | // will be given a grace period before the master adopts them. |
| 11378 | // After which, the master will acknowledge any associated operation |
| 11379 | // status updates. |
| 11380 | slave->markOperationAsOrphan(operation); |
| 11381 | } |
| 11382 | } |
| 11383 | |
| 11384 | |
| 11385 | void Master::updateOperation( |
no test coverage detected