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

Method allocatedResources

src/slave/slave.cpp:10872–10899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10870
10871
10872Resources 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
10902Executor::Executor(

Callers 8

operator()Method · 0.80
foreachvalueFunction · 0.80
__runMethod · 0.80
subscribeMethod · 0.80
registerExecutorMethod · 0.80
reregisterExecutorMethod · 0.80
_statusUpdateMethod · 0.80
foreachvalueFunction · 0.80

Calls 1

resourcesMethod · 0.45

Tested by

no test coverage detected