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

Function createTask

src/tests/mesos.hpp:953–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

951 typename TOffer,
952 typename TScalar>
953inline TTaskInfo createTask(
954 const TSlaveID& slaveId,
955 const TResources& resourceRequests,
956 const TCommandInfo& command,
957 const Option<TExecutorID>& executorId = None(),
958 const std::string& name = "test-task",
959 const std::string& id = id::UUID::random().toString(),
960 const google::protobuf::Map<std::string, TScalar>& resourceLimits = {})
961{
962 TTaskInfo task;
963 task.set_name(name);
964 task.mutable_task_id()->set_value(id);
965 setAgentID(&task, slaveId);
966 task.mutable_resources()->CopyFrom(resourceRequests);
967 if (!resourceLimits.empty()) {
968 *task.mutable_limits() = resourceLimits;
969 }
970 if (executorId.isSome()) {
971 TExecutorInfo executor;
972 executor.mutable_executor_id()->CopyFrom(executorId.get());
973 executor.mutable_command()->CopyFrom(command);
974 task.mutable_executor()->CopyFrom(executor);
975 } else {
976 task.mutable_command()->CopyFrom(command);
977 }
978
979 return task;
980}
981
982
983template <

Callers 15

TEST_PFunction · 0.70
launchParentContainerMethod · 0.70
TEST_FFunction · 0.70
TEST_PFunction · 0.70
TEST_FFunction · 0.70
TEST_FFunction · 0.70
TEST_FFunction · 0.70
TEST_PFunction · 0.70
TEST_FFunction · 0.70
createOperationsMethod · 0.70

Calls 10

NoneClass · 0.85
randomFunction · 0.85
setAgentIDFunction · 0.85
getAgentIDFunction · 0.85
CopyFromMethod · 0.80
toStringMethod · 0.45
emptyMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45
resourcesMethod · 0.45

Tested by

no test coverage detected