> On March 6, 2015, 1:50 p.m., Joerg Schad wrote: > > The semantics of sum is still the old semantics (i.e. not considering > > non-scalar ressources). If yes could you add a small note about this in the > > description?
That's correct. I'll add a comment saying that this function does not yield correct results over non-scalar resources and that it should be deprecated once we introduce a concept such as ClusterResources which handles resources across multiple slaves correctly. > On March 6, 2015, 1:50 p.m., Joerg Schad wrote: > > include/mesos/resources.hpp, lines 107-108 > > <https://reviews.apache.org/r/31183/diff/6/?file=883408#file883408line107> > > > > Could you provide a comment about the functionality and especially the > > (for non-scalar resources non-obvious) semantics here? See my comment above. - Michael ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31183/#review75486 ----------------------------------------------------------- On March 3, 2015, 8:26 p.m., Michael Park wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/31183/ > ----------------------------------------------------------- > > (Updated March 3, 2015, 8:26 p.m.) > > > Review request for mesos, Alexander Rukletsov, Benjamin Hindman, Ben Mahler, > and Jie Yu. > > > Bugs: MESOS-2373 > https://issues.apache.org/jira/browse/MESOS-2373 > > > Repository: mesos > > > Description > ------- > > This is the start of a patch chain for converting `Resources` to > `hashmap<SlaveID, Resources>` in places where we have an aggregate of > resources across multiple slaves. In short, scalar resources aggregate > correctly across multiple slaves, but non-scalar resources (e.g. ports) do > not aggregate correctly. Please refer to the JIRA ticket for further details. > > The function `sum` is factored out to facilitate small patches. The following > is the strategy and why this function will be useful: > > (1) Update a variable `resources` in a component (e.g. master) from > `Resources` to `hashmap<SlaveID, Resources>`. > (2) For callsites where we pass `resources` to another component (e.g. > allocator), we'll pass `sum(resources.values())` instead to preserve the > existing behavior in the other component. > > > Diffs > ----- > > include/mesos/resources.hpp da6d48871a0061d8bbf5e681dd6e7edac659d812 > src/master/allocator/mesos/hierarchical.hpp > c0b1da75565d9dc7728c5566f01815234163fc47 > src/tests/hierarchical_allocator_tests.cpp > 93753d1c04159a04a733927a487eb69505438e32 > > Diff: https://reviews.apache.org/r/31183/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Michael Park > >