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

Method registerExecutor

src/slave/slave.cpp:5483–5650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5481
5482
5483void Slave::registerExecutor(
5484 const UPID& from,
5485 const FrameworkID& frameworkId,
5486 const ExecutorID& executorId)
5487{
5488 LOG(INFO) << "Got registration for executor '" << executorId
5489 << "' of framework " << frameworkId << " from "
5490 << stringify(from);
5491
5492 CHECK(state == RECOVERING || state == DISCONNECTED ||
5493 state == RUNNING || state == TERMINATING)
5494 << state;
5495
5496 if (state == RECOVERING) {
5497 LOG(WARNING) << "Shutting down executor '" << executorId
5498 << "' of framework " << frameworkId
5499 << " because the agent is still recovering";
5500 reply(ShutdownExecutorMessage());
5501 return;
5502 }
5503
5504 if (state == TERMINATING) {
5505 LOG(WARNING) << "Shutting down executor '" << executorId
5506 << "' of framework " << frameworkId
5507 << " because the agent is terminating";
5508 reply(ShutdownExecutorMessage());
5509 return;
5510 }
5511
5512 Framework* framework = getFramework(frameworkId);
5513 if (framework == nullptr) {
5514 LOG(WARNING) << "Shutting down executor '" << executorId
5515 << "' as the framework " << frameworkId
5516 << " does not exist";
5517
5518 reply(ShutdownExecutorMessage());
5519 return;
5520 }
5521
5522 CHECK(framework->state == Framework::RUNNING ||
5523 framework->state == Framework::TERMINATING)
5524 << framework->state;
5525
5526 if (framework->state == Framework::TERMINATING) {
5527 LOG(WARNING) << "Shutting down executor '" << executorId
5528 << "' as the framework " << frameworkId
5529 << " is terminating";
5530
5531 reply(ShutdownExecutorMessage());
5532 return;
5533 }
5534
5535 Executor* executor = framework->getExecutor(executorId);
5536
5537 // Check the status of the executor.
5538 if (executor == nullptr) {
5539 LOG(WARNING) << "Unexpected executor '" << executorId
5540 << "' registering for framework " << frameworkId;

Callers

nothing calls this directly

Calls 15

getLibprocessPidPathFunction · 0.85
checkpointFunction · 0.85
deferFunction · 0.85
getExecutorMethod · 0.80
checkpointMethod · 0.80
everSentTaskMethod · 0.80
MergeFromMethod · 0.80
allocatedResourcesMethod · 0.80
sendMethod · 0.65
stringifyFunction · 0.50
idMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected