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



Good cleanup thanks! Just two issues below that I would like to resolve prior 
to shipping.


src/master/allocator/mesos/hierarchical.cpp
Lines 1610-1612 (patched)
<https://reviews.apache.org/r/66016/#comment279319>

    Hm.. as an aside, looks like `Option::getOrElse` could be improved  to 
avoid copying in cases like this?
    
    E.g.
    
    ```
      T&& getOrElse(T&& _t) && { return std::move(isNone() ? _t : t); }
      T&& getOrElse(T&& _t) const && { return std::move(isNone() ? _t : t); }
    ```



src/master/allocator/mesos/hierarchical.cpp
Lines 1616 (patched)
<https://reviews.apache.org/r/66016/#comment279320>

    This should probably be renamed to s/Resources/ScalarQuantities/ to be 
consistent with your other naming? Want to do that in a separate patch?



src/master/allocator/mesos/hierarchical.cpp
Lines 2002-2003 (original), 1972-1973 (patched)
<https://reviews.apache.org/r/66016/#comment279321>

    Why isn't this:
    
    ```
    rolesConsumedQuotaScalarQuantites[role] +=
      newQuotaAllocationScalarQuantities;
    ```
    
    It's not obvious to me, are the two equivalent? The one included in the 
patch seems to be including resources that aren't part of the quota guarantee? 
Seems weird?



src/master/allocator/mesos/hierarchical.cpp
Lines 2012-2014 (original), 1975-1977 (patched)
<https://reviews.apache.org/r/66016/#comment279322>

    Not a new problem, but looks like a comment is warranted here, I couldn't 
easily figure out why one subtracts new quota allocation and the other 
subtracts unreserved allocation.


- Benjamin Mahler


On March 10, 2018, 12:44 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66016/
> -----------------------------------------------------------
> 
> (Updated March 10, 2018, 12:44 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Kapil Arya, Joseph Wu, Michael 
> Park, and Till Toenshoff.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The current allocation logic maintains several states
> such as allocated-reservation, unsatisfied-quota and etc.
> This patch refactors the logic so that we only need to
> maintain a per-quota-role map to track role consumed quota.
> 
> 
> Diffs
> -----
> 
>   src/master/allocator/mesos/hierarchical.cpp 
> 5d30d1d4d4bbb5431745f61b5318b39c5c3a7117 
> 
> 
> Diff: https://reviews.apache.org/r/66016/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>

Reply via email to