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

Method addOperation

src/master/master.cpp:11350–11382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11348
11349
11350void 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
11385void Master::updateOperation(

Callers 1

foreachFunction · 0.45

Calls 15

getResourceProviderIdFunction · 0.85
isSpeculativeOperationFunction · 0.85
isTerminalStateFunction · 0.85
getConsumedResourcesFunction · 0.85
typeMethod · 0.80
infoMethod · 0.80
markOperationAsOrphanMethod · 0.80
atMethod · 0.80
errorMethod · 0.65
stateMethod · 0.45
isErrorMethod · 0.45

Tested by

no test coverage detected