| 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, |