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

Function json

src/slave/http.cpp:169–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167namespace mesos {
168
169static void json(JSON::ObjectWriter* writer, const TaskInfo& task)
170{
171 writer->field("id", task.task_id().value());
172 writer->field("name", task.name());
173 writer->field("slave_id", task.slave_id().value());
174 writer->field("resources", task.resources());
175
176 // Tasks are not allowed to mix resources allocated to
177 // different roles, see MESOS-6636.
178 writer->field("role", task.resources().begin()->allocation_info().role());
179
180 if (task.has_command()) {
181 writer->field("command", task.command());
182 }
183 if (task.has_executor()) {
184 writer->field("executor_id", task.executor().executor_id().value());
185 }
186 if (task.has_discovery()) {
187 writer->field("discovery", JSON::Protobuf(task.discovery()));
188 }
189}
190
191namespace internal {
192namespace slave {

Callers

nothing calls this directly

Calls 8

ProtobufClass · 0.85
fieldMethod · 0.80
commandMethod · 0.80
executorMethod · 0.80
valueMethod · 0.45
nameMethod · 0.45
resourcesMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected