mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <bmah...@apache.org>
Subject Re: Review Request 70542: Added a random sorter helper to find active internal nodes.
Date Thu, 25 Apr 2019 18:22:36 GMT

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


Fix it, then Ship it!





src/master/allocator/sorter/random/sorter.hpp
Lines 128 (patched)
<https://reviews.apache.org/r/70542/#comment301167>

    hashset and activeInternalNodes()?



src/master/allocator/sorter/random/sorter.cpp
Lines 567-568 (patched)
<https://reviews.apache.org/r/70542/#comment301168>

    Curious if we can use auto here to store the lambda?
    
    ```
    auto searchActiveInternal = 
      [&searchActiveInternal](Node* node, set<Node*>& result) -> bool {
    ```



src/master/allocator/sorter/random/sorter.cpp
Lines 570 (patched)
<https://reviews.apache.org/r/70542/#comment301169>

    newline here?



src/master/allocator/sorter/random/sorter.cpp
Lines 571-577 (patched)
<https://reviews.apache.org/r/70542/#comment301170>

    This seems a bit simpler?
    
    ```
           case Node::ACTIVE_LEAF:   return true;
           case Node::INACTIVE_LEAF: return false;
           
           case Node::INTERNAL: {
              bool active = false;
              
              foreach (Node* child, node->children) {
                if (searchActiveInternal(child, result)) {
                  active = true;
                }
              }
    
              if (active) {
                result.insert(node);
              }
              
              return active;
           } 
    ```


- Benjamin Mahler


On April 24, 2019, 10:14 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70542/
> -----------------------------------------------------------
> 
> (Updated April 24, 2019, 10:14 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Active internal nodes are defined as internal nodes that have
> at least one active leaf node.
> 
> 
> Diffs
> -----
> 
>   src/master/allocator/sorter/random/sorter.hpp 125ce84761e4c930370912151700ddda35d7b6c1

>   src/master/allocator/sorter/random/sorter.cpp bbe130dbf3b158ea14f9572bc5d14200fcd85127

> 
> 
> Diff: https://reviews.apache.org/r/70542/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


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