> On March 18, 2015, 12:27 a.m., Alexander Rukletsov wrote: > > src/common/resources.cpp, lines 44-49 > > <https://reviews.apache.org/r/32140/diff/1/?file=897349#file897349line44> > > > > Why these operatos (also those that were here before) are defined here > > and not in `include/mesos/type_utils.{hpp|cpp}`?
I defined them here to keep consistency with the operators for `DiskInfo`. I think it's because we don't really need these comparators outside of this file. @jieyu: What do you think? > On March 18, 2015, 12:27 a.m., Alexander Rukletsov wrote: > > src/common/resources.cpp, line 156 > > <https://reviews.apache.org/r/32140/diff/1/?file=897349#file897349line156> > > > > Can we subtract resources reserved for different frameworks? Nope. Good find, this was a bug I fixed earlier that I found while writing tests. > On March 18, 2015, 12:27 a.m., Alexander Rukletsov wrote: > > src/common/resources.cpp, line 394 > > <https://reviews.apache.org/r/32140/diff/1/?file=897349#file897349line394> > > > > I would put accent on reservation: "Invalid reservation ..." Done. > On March 18, 2015, 12:27 a.m., Alexander Rukletsov wrote: > > src/common/resources.cpp, lines 437-439 > > <https://reviews.apache.org/r/32140/diff/1/?file=897349#file897349line437> > > > > This checks whether a resource is reserved for a role. Do we need to > > have an overload for framework reservations? Or add optional `FrameworkID` > > arg? That will be included in a subsequent task, [MESOS-2490](https://issues.apache.org/jira/browse/MESOS-2490), where we "teach the allocator to offer the resources to the particular framework rather than the role". I've scoped out the current task to simply to allow the framework to send the Reserve operation and update the allocator resources. - Michael ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32140/#review76752 ----------------------------------------------------------- On March 18, 2015, 7:44 p.m., Michael Park wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32140/ > ----------------------------------------------------------- > > (Updated March 18, 2015, 7:44 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 da6d48871a0061d8bbf5e681dd6e7edac659d812 > src/common/resources.cpp 2c99b6884d7296099e19e2e3182cbe11b5e1e059 > src/tests/mesos.hpp 45e35204d1aa876fa0c871acf0f21afcd5ababe8 > src/tests/resources_tests.cpp 7e0ad98c3366f647f190363a0e6b576dbfc7d415 > > Diff: https://reviews.apache.org/r/32140/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Michael Park > >
