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

Method statusUpdate

src/examples/test_framework.cpp:147–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 {}
146
147 void statusUpdate(SchedulerDriver* driver, const TaskStatus& status) override
148 {
149 int taskId = lexical_cast<int>(status.task_id().value());
150
151 cout << "Task " << taskId << " is in state " << status.state() << endl;
152
153 if (status.state() == TASK_FINISHED) {
154 tasksFinished++;
155 }
156
157 if (status.state() == TASK_LOST ||
158 status.state() == TASK_KILLED ||
159 status.state() == TASK_FAILED) {
160 cout << "Aborting because task " << taskId
161 << " is in unexpected state " << status.state()
162 << " with reason " << status.reason()
163 << " from source " << status.source()
164 << " with message '" << status.message() << "'" << endl;
165 driver->abort();
166 }
167
168 if (!implicitAcknowledgements) {
169 driver->acknowledgeStatusUpdate(status);
170 }
171
172 if (tasksFinished == totalTasks) {
173 driver->stop();
174 }
175 }
176
177 void frameworkMessage(
178 SchedulerDriver* driver,

Callers

nothing calls this directly

Calls 6

abortMethod · 0.65
stopMethod · 0.65
valueMethod · 0.45
stateMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected