| 10870 | |
| 10871 | |
| 10872 | Resources Framework::allocatedResources() const |
| 10873 | { |
| 10874 | Resources allocated; |
| 10875 | |
| 10876 | foreachvalue (const Executor* executor, executors) { |
| 10877 | allocated += executor->allocatedResources(); |
| 10878 | } |
| 10879 | |
| 10880 | hashset<ExecutorID> pendingExecutors; |
| 10881 | |
| 10882 | typedef hashmap<TaskID, TaskInfo> TaskMap; |
| 10883 | foreachvalue (const TaskMap& pendingTasks, pendingTasks) { |
| 10884 | foreachvalue (const TaskInfo& task, pendingTasks) { |
| 10885 | allocated += task.resources(); |
| 10886 | |
| 10887 | ExecutorInfo executorInfo = slave->getExecutorInfo(info, task); |
| 10888 | const ExecutorID& executorId = executorInfo.executor_id(); |
| 10889 | |
| 10890 | if (!executors.contains(executorId) && |
| 10891 | !pendingExecutors.contains(executorId)) { |
| 10892 | allocated += executorInfo.resources(); |
| 10893 | pendingExecutors.insert(executorId); |
| 10894 | } |
| 10895 | } |
| 10896 | } |
| 10897 | |
| 10898 | return allocated; |
| 10899 | } |
| 10900 | |
| 10901 | |
| 10902 | Executor::Executor( |
no test coverage detected