You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2015/12/04 17:43:38 UTC
mesos git commit: Quota: Properly initialized the sorter for quota'ed
roles in the allocator.
Repository: mesos
Updated Branches:
refs/heads/master 1d6ea2b9c -> 5107e68e7
Quota: Properly initialized the sorter for quota'ed roles in the allocator.
Addendum to b9762afeb851662fc6122e177abf1c1a4f4921ae.
Review: https://reviews.apache.org/r/40961
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5107e68e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5107e68e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5107e68e
Branch: refs/heads/master
Commit: 5107e68e7bfb0e8fb420445107c371b0190de235
Parents: 1d6ea2b
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Fri Dec 4 11:32:16 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Fri Dec 4 11:32:16 2015 -0500
----------------------------------------------------------------------
src/master/allocator/mesos/hierarchical.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/5107e68e/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 6d82ae7..d05be4c 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -971,6 +971,14 @@ void HierarchicalAllocatorProcess::setQuota(
roles[role].quota = quota;
quotaRoleSorter->add(role, roles[role].info.weight());
+ // Copy allocation information for the quota'ed role.
+ hashmap<SlaveID, Resources> roleAllocation = roleSorter->allocation(role);
+ foreachpair (
+ const SlaveID& slaveId, const Resources& resources, roleAllocation) {
+ quotaRoleSorter->allocated(
+ role, slaveId, resources.unreserved());
+ }
+
// TODO(alexr): Print all quota info for the role.
LOG(INFO) << "Set quota " << quota.guarantee() << " for role '" << role
<< "'";