mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meng Zhu <m...@mesosphere.io>
Subject Re: Review Request 67369: Introduced a weighted shuffle algorithm implementation.
Date Thu, 31 May 2018 19:47:50 GMT

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




src/master/allocator/sorter/random/utils.hpp
Lines 49 (patched)
<https://reviews.apache.org/r/67369/#comment286476>

    s/-/ - /



src/master/allocator/sorter/random/utils.hpp
Lines 53-59 (patched)
<https://reviews.apache.org/r/67369/#comment286523>

    Why do we need to construct the random distribution every time? How about:
    
    ```
    std::uniform_real_distribution<> dis(0.0, 1.0);
    for (...) {
      ...
      keys[i] = 0.0 - std::pow(dis(urbg), (1.0 / weights[i]));
    }
    ```



src/master/allocator/sorter/random/utils.hpp
Lines 75 (patched)
<https://reviews.apache.org/r/67369/#comment286532>

    ditto


- Meng Zhu


On May 29, 2018, 5:55 p.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67369/
> -----------------------------------------------------------
> 
> (Updated May 29, 2018, 5:55 p.m.)
> 
> 
> Review request for mesos, Gaston Kleiman, Greg Mann, and meng han.
> 
> 
> Bugs: MESOS-8936
>     https://issues.apache.org/jira/browse/MESOS-8936
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This will be used by the random sorter in order to support weights.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am b7184ceccef5f2e985d905c155156f95c7a7c7b4 
>   src/master/allocator/sorter/random/utils.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/67369/diff/1/
> 
> 
> Testing
> -------
> 
> Test added in subsequent patch.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message