----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58508/#review177417 -----------------------------------------------------------
Per an offline discussion with mpark, I'm not sure that it will be clear what 'inheritable' means, the following seems more clear: ``` resources.allocatableTo(role); ``` This would include unreserved resources, but does not include resources reserved to a non-ancestor role. Then in the allocator code, if we want to distinguish between unreserved resources and reserved resources we could do the following: ``` Resources reserved = resources.allocatableTo(role) - resources.unreserved(); ``` What I find a bit confusing about adding something like `inheritablyReservedToRole(role)` is that it suggests that a reservation has been inherited to this role, whereas the reality is that there is a reservation to an ancestor and we simply are allowed to be allocated the reserved resources, but we don't have a reservation on this role. src/tests/resources_tests.cpp Lines 1540-1541 (patched) <https://reviews.apache.org/r/58508/#comment250953> It seems a little odd that "bx" is the father and "b" is the uncle, I would expect that "b" is the father and maybe something like "b2" is the uncle? - Benjamin Mahler On April 20, 2017, 4:18 p.m., Jay Guo wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58508/ > ----------------------------------------------------------- > > (Updated April 20, 2017, 4:18 p.m.) > > > Review request for mesos and Michael Park. > > > Bugs: MESOS-7149 > https://issues.apache.org/jira/browse/MESOS-7149 > > > Repository: mesos > > > Description > ------- > > A reservation is inheritable by 'role' iff: > - it is reserved to ancestor of 'role' in hierarchy, OR > - it is reserved to 'role' itself. > > This is a helper function for reservation delegate, where reserved > resources can be 'delegated' downwards in the hierarchy. > > > Diffs > ----- > > include/mesos/resources.hpp 74583e3c784f22b45cce81f07c5a69b339e1684d > src/common/resources.cpp 77bac0c4390da905016a942991b14a79877f8455 > src/tests/resources_tests.cpp 4cf320d802a749f1419ac5b9f63b6c73b0c974be > > > Diff: https://reviews.apache.org/r/58508/diff/2/ > > > Testing > ------- > > make check > > > Thanks, > > Jay Guo > >
