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

Method Slave

src/master/master.cpp:12515–12559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12513
12514
12515Slave::Slave(
12516 Master* const _master,
12517 SlaveInfo _info,
12518 const UPID& _pid,
12519 const MachineID& _machineId,
12520 const string& _version,
12521 vector<SlaveInfo::Capability> _capabilites,
12522 const Time& _registeredTime,
12523 vector<Resource> _checkpointedResources,
12524 const Option<UUID>& _resourceVersion,
12525 vector<ExecutorInfo> executorInfos,
12526 vector<Task> tasks)
12527 : master(_master),
12528 id(_info.id()),
12529 info(std::move(_info)),
12530 machineId(_machineId),
12531 pid(_pid),
12532 version(_version),
12533 capabilities(std::move(_capabilites)),
12534 registeredTime(_registeredTime),
12535 connected(true),
12536 active(true),
12537 checkpointedResources(std::move(_checkpointedResources)),
12538 resourceVersion(_resourceVersion),
12539 observer(nullptr)
12540{
12541 CHECK(info.has_id());
12542
12543 Try<Resources> resources = applyCheckpointedResources(
12544 info.resources(),
12545 checkpointedResources);
12546
12547 // NOTE: This should be validated during slave recovery.
12548 CHECK_SOME(resources);
12549 totalResources = resources.get();
12550
12551 foreach (ExecutorInfo& executorInfo, executorInfos) {
12552 CHECK(executorInfo.has_framework_id());
12553 addExecutor(executorInfo.framework_id(), std::move(executorInfo));
12554 }
12555
12556 foreach (Task& task, tasks) {
12557 addTask(new Task(std::move(task)));
12558 }
12559}
12560
12561
12562Slave::~Slave()

Callers

nothing calls this directly

Calls 4

idMethod · 0.45
resourcesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected