----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32140/#review80201 -----------------------------------------------------------
src/common/resources.cpp <https://reviews.apache.org/r/32140/#comment129980> Can we replace it by ``` if !addable(left, right) { return false; } ``` ? Or even add `addable()` check to the chain of checks below? src/common/resources.cpp <https://reviews.apache.org/r/32140/#comment129981> Remove period at the end. src/common/resources.cpp <https://reviews.apache.org/r/32140/#comment129988> Agree with Jie, I spent some time trying to understand what's going on here and what the implications are. * `.has_reservation()` means a resource is dynamically reserved; * `.role() != "*"` means a resource is reserved for a role. Currently we do not allow reservations for "*" role, this is validated above. But what is the semantics of `isUnreserved()` function? It used to be "a resource belongs to a default role". Let's write a comment to document our intention here, mentioning all assumptions that we currently make. src/tests/mesos.hpp <https://reviews.apache.org/r/32140/#comment129998> Why not putting the definition into `tests/mesos.cpp`? Here and below. - Alexander Rukletsov On April 15, 2015, 4:12 p.m., Michael Park wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32140/ > ----------------------------------------------------------- > > (Updated April 15, 2015, 4:12 p.m.) > > > Review request for mesos, Alexander Rukletsov, Ben Mahler, and Jie Yu. > > > Bugs: MESOS-2476 > https://issues.apache.org/jira/browse/MESOS-2476 > > > Repository: mesos > > > Description > ------- > > `Resource::ReservationInfo` was introduced in > [r32139](https://reviews.apache.org/r/32139). We need to consider it in our > `Resources` class implementation. > > ### `Resources::flatten` > > `flatten` is used as the utility function to cross reservation boundaries > without affecting the given resources. Since the reservation is now specified > by the (`role`, `reservation`) pair, `flatten` needs to consider > `ReservationInfo` as well. > > ### `Resources::validate` > > If `role == "*"`, then `reservation` field must not be set. > > ### `Resources` comparators > > `operator==`, `addable` and `substractable` need to test for > `ReservationInfo` as well. > > > Diffs > ----- > > include/mesos/resources.hpp 56affd45e1e71e96ff5778b43271f81b9b9a9e4d > src/common/resources.cpp 2c99b6884d7296099e19e2e3182cbe11b5e1e059 > src/tests/mesos.hpp 0e98572a62ae05437bd2bc800c370ad1a0c43751 > src/tests/resources_tests.cpp 7e0ad98c3366f647f190363a0e6b576dbfc7d415 > > Diff: https://reviews.apache.org/r/32140/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Michael Park > >
