> On Feb. 23, 2015, 7:36 p.m., Alexander Rukletsov wrote:
> > src/master/allocator/sorter/sorter.hpp, lines 64-66
> > <https://reviews.apache.org/r/31183/diff/2/?file=869986#file869986line64>
> >
> >     Maybe we can provide overrides here to avoid duplicating `foreach`s in 
> > the client code in `HierarchicalAllocator`?
> 
> Michael Park wrote:
>     I had considered this and pulled back on it because the call-sites 
> currently look like:
>     
>     ```cpp
>     foreachpair (const SlaveID& slaveId, const Resources& allocated, used) {
>       roleSorter->allocated(role, slaveId, allocated.unreserved());
>       frameworkSorters[role]->add(slaveId, allocated);
>       frameworkSorters[role]->allocated(frameworkId.value(), slaveId, 
> allocated);
>     }
>     ```
>     
>     With the overload, it doesn't get all that much better because of the 
> `allocated.unreserved()` call.
>     
>     ```cpp
>     foreachpair (const SlaveID& slaveId, const Resources& allocated, used) {
>       roleSorter->allocated(role, slaveId, allocated.unreserved());
>     }
>     frameworkSorters[role]->add(used);
>     frameworkSorters[role]->allocated(frameworkId.value(), used);
>     ```
>     
>     I think with 2 such loops we can punt on it for now?
> 
> Alexander Rukletsov wrote:
>     Your comment does make sense to me. I don't have enough context here. The 
> general questions here are: do we want to aggregate resources across slaves 
> somehow? what API do we want to expose (per slave or aggregated)?

Yeah, BenM actually reached out to Vinod and BenH to get more context on this 
topic for precisely that question. I think since we already have the notion of 
`hashmap<SlaveID, Resources>` floating around for Offers related code, this is 
the less distruptive solution for now. But I guess this is just a prototype 
patch until we get that question clearly answered.


- Michael


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31183/#review73586
-----------------------------------------------------------


On Feb. 25, 2015, 1:16 a.m., Michael Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31183/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2015, 1:16 a.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
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp da6d48871a0061d8bbf5e681dd6e7edac659d812 
>   src/common/resources.cpp 2c99b6884d7296099e19e2e3182cbe11b5e1e059 
>   src/master/allocator/allocator.hpp b67b8fddbd7a3fffc6fe24d5e77cd1db8cb6f69b 
>   src/master/allocator/mesos/allocator.hpp 
> fb898f1175b61b442204e6e38c69ccc2838a646f 
>   src/master/allocator/mesos/hierarchical.hpp 
> c0b1da75565d9dc7728c5566f01815234163fc47 
>   src/master/allocator/sorter/drf/sorter.hpp 
> 4366710d6530b784aa5094813328d0e338239ba0 
>   src/master/allocator/sorter/drf/sorter.cpp 
> 2f69f384b95ff20d3ee429a4570a8cffa74d8e8b 
>   src/master/allocator/sorter/sorter.hpp 
> e2efb27b11dbea42dd73f81e5db0d6d2b0a6034b 
>   src/master/http.cpp 117c0ee720a60a1d8a25359028bad803f1fc2b07 
>   src/master/master.hpp d414061b1aa7b4cac6ab9a3cc14e8e028f9370d0 
>   src/master/master.cpp 76e217d16c03e587ea4c0afca94c58b2212f0f93 
>   src/tests/hierarchical_allocator_tests.cpp 
> 93753d1c04159a04a733927a487eb69505438e32 
>   src/tests/mesos.hpp 6b9656b2b858df75e725aaa042c447b755899c87 
>   src/tests/sorter_tests.cpp 42442353afe7bd3d1a5b43992f8ae191ac19bdcd 
> 
> Diff: https://reviews.apache.org/r/31183/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Michael Park
> 
>

Reply via email to