void addExecutor(const FrameworkID& frameworkId, const ExecutorInfo& executorInfo) { CHECK(!hasExecutor(frameworkId, executorInfo.executor_id())); executors[frameworkId][executorInfo.executor_id()] = executorInfo; // Update the resources in use to reflect running this executor. resourcesInUse += executorInfo.resources(); }
void addExecutor(const FrameworkID& frameworkId, const ExecutorInfo& executorInfo) { CHECK(!hasExecutor(frameworkId, executorInfo.executor_id())) << "Duplicate executor " << executorInfo.executor_id() << " of framework " << frameworkId; executors[frameworkId][executorInfo.executor_id()] = executorInfo; usedResources[frameworkId] += executorInfo.resources(); }
void removeExecutor(const FrameworkID& frameworkId, const ExecutorID& executorId) { if (hasExecutor(frameworkId, executorId)) { // Update the resources in use to reflect removing this executor. resourcesInUse -= executors[frameworkId][executorId].resources(); executors[frameworkId].erase(executorId); if (executors[frameworkId].size() == 0) { executors.erase(frameworkId); } } }
void removeExecutor(const FrameworkID& frameworkId, const ExecutorID& executorId) { CHECK(hasExecutor(frameworkId, executorId)) << "Unknown executor " << executorId << " of framework " << frameworkId; usedResources[frameworkId] -= executors[frameworkId][executorId].resources(); // XXX Remove. executors[frameworkId].erase(executorId); if (executors[frameworkId].empty()) { executors.erase(frameworkId); } }