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

Method addTask

src/master/master.cpp:3883–3909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3881
3882
3883void Master::addTask(
3884 const TaskInfo& task,
3885 Framework* framework,
3886 Slave* slave)
3887{
3888 CHECK_NOTNULL(framework);
3889 CHECK_NOTNULL(slave);
3890 CHECK(slave->connected) << "Adding task " << task.task_id()
3891 << " to disconnected agent " << *slave;
3892
3893 // Note that we explicitly convert from protobuf to `Resources` here
3894 // and then use the result below to avoid performance penalty for multiple
3895 // conversions and validations implied by conversion.
3896 // Conversion is safe, as resources have already passed validation.
3897 const Resources resources = task.resources();
3898
3899 LOG(INFO) << "Adding task " << task.task_id()
3900 << " with resources " << resources
3901 << " of framework " << *framework
3902 << " on agent " << *slave;
3903
3904 // Add the task to the framework and slave.
3905 Task* t = new Task(protobuf::createTask(task, TASK_STAGING, framework->id()));
3906
3907 slave->addTask(t);
3908 framework->addTask(t);
3909}
3910
3911
3912

Callers 2

recoverFrameworkMethod · 0.45
foreachkeyFunction · 0.45

Calls 6

isTerminalStateFunction · 0.85
createTaskFunction · 0.50
resourcesMethod · 0.45
idMethod · 0.45
containsMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected