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




src/master/allocator/sorter/drf/sorter.hpp
Lines 249 (patched)
<https://reviews.apache.org/r/68732/#comment292932>

    This is a good place to use `mutable` to express logical constness. Then we 
can mark the corresponding member functions `const`.



src/master/allocator/sorter/drf/sorter.cpp
Line 311 (original), 311 (patched)
<https://reviews.apache.org/r/68732/#comment292937>

    Not yours, but we should probably use read-only access here.



src/master/allocator/sorter/drf/sorter.cpp
Lines 316 (patched)
<https://reviews.apache.org/r/68732/#comment292936>

    Can't we just use the client map?
    
    CHECK_NOTNONE(clients.get(path))->weight = weight;



src/master/allocator/sorter/drf/sorter.cpp
Line 596 (original), 627 (patched)
<https://reviews.apache.org/r/68732/#comment292933>

    make it `const` as mentioned



src/master/allocator/sorter/drf/sorter.cpp
Line 626 (original), 657 (patched)
<https://reviews.apache.org/r/68732/#comment292934>

    ditto `const`



src/master/allocator/sorter/random/sorter.hpp
Lines 241 (patched)
<https://reviews.apache.org/r/68732/#comment292935>

    ditto `mutable` and make member functions `const` and other issues 
mentioned above.


- Meng Zhu


On Sept. 18, 2018, 12:58 p.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68732/
> -----------------------------------------------------------
> 
> (Updated Sept. 18, 2018, 12:58 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman and Meng Zhu.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This avoids making excessive map lookups each time we calculate the
> share for a node in the tree. Now, when the weight is needed, the
> value is cached. If the weight gets updated, we update the cached
> value. This approach proved cleaner than trying to ensure freshly
> constructed nodes have the right weight.
> 
> 
> Diffs
> -----
> 
>   src/master/allocator/sorter/drf/sorter.hpp 
> 5a4fa5e2dca61168923261230b1f5c245354cbb7 
>   src/master/allocator/sorter/drf/sorter.cpp 
> 07e5482f37da8585d0313e9f70bd8105efa19533 
>   src/master/allocator/sorter/random/sorter.hpp 
> 7f6c0de70e3ae03d7362fb9e140b93435e530499 
>   src/master/allocator/sorter/random/sorter.cpp 
> d17f8afa96b66e63f56ccaa472ad398f8f517b65 
> 
> 
> Diff: https://reviews.apache.org/r/68732/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>

Reply via email to