You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by James Peach <jp...@apache.org> on 2017/07/11 11:13:11 UTC

Review Request 60764: Refactor isolator dependency checking.

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

Review request for mesos, Qian Zhang and Jiang Yan Xu.


Bugs: MESOS-7675
    https://issues.apache.org/jira/browse/MESOS-7675


Repository: mesos


Description
-------

Refactor the isolator dependency checks to immediately tokenize the
isolator string, which makes it easier to check various consistency
conditions.


Diffs
-----

  src/slave/containerizer/mesos/containerizer.cpp 9376d14d66f5dc7e91c7c0e9da253f5eb9347539 


Diff: https://reviews.apache.org/r/60764/diff/1/


Testing
-------

make check (Fedora 26)


Thanks,

James Peach


Re: Review Request 60764: Refactored isolator dependency checking.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60764/
-----------------------------------------------------------

(Updated Aug. 22, 2017, 8:28 p.m.)


Review request for mesos, Qian Zhang and Jiang Yan Xu.


Bugs: MESOS-7675
    https://issues.apache.org/jira/browse/MESOS-7675


Repository: mesos


Description
-------

Refactored the isolator dependency checks to immediately tokenize
the isolator string, which makes it easier to check various consistency
conditions.


Diffs (updated)
-----

  src/slave/containerizer/mesos/containerizer.cpp 5772421c3078d36225b946a5286b8c1bf2f007e8 


Diff: https://reviews.apache.org/r/60764/diff/8/

Changes: https://reviews.apache.org/r/60764/diff/7-8/


Testing
-------

make check (Fedora 26)


Thanks,

James Peach


Re: Review Request 60764: Refactored isolator dependency checking.

Posted by James Peach <jp...@apache.org>.

> On Aug. 22, 2017, 3:32 a.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/containerizer.cpp
> > Line 154 (original), 169 (patched)
> > <https://reviews.apache.org/r/60764/diff/7/?file=1796964#file1796964line169>
> >
> >     Can you create a LinkedHashset (similar to LinkedHashmap) in stout which preserve the insertion order. this solves one issues about the ordering of the isolators is not preserved.
> >     
> >     I would at least add a TODO here (i do wish you can follow up :))

Added a TODO referring to [MESOS-7643](https://issues.apache.org/jira/browse/MESOS-7643)


- James


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


On July 11, 2017, 11:13 a.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60764/
> -----------------------------------------------------------
> 
> (Updated July 11, 2017, 11:13 a.m.)
> 
> 
> Review request for mesos, Qian Zhang and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7675
>     https://issues.apache.org/jira/browse/MESOS-7675
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Refactored the isolator dependency checks to immediately tokenize
> the isolator string, which makes it easier to check various consistency
> conditions.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/containerizer.cpp ff192bb085f3554ad1b1f20fb73bf827bf04ef13 
> 
> 
> Diff: https://reviews.apache.org/r/60764/diff/7/
> 
> 
> Testing
> -------
> 
> make check (Fedora 26)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 60764: Refactored isolator dependency checking.

Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60764/#review183435
-----------------------------------------------------------


Fix it, then Ship it!




Thanks for the cleanup!


src/slave/containerizer/mesos/containerizer.cpp
Lines 148 (patched)
<https://reviews.apache.org/r/60764/#comment259440>

    Let's just inline this method. There is only one user for this method.



src/slave/containerizer/mesos/containerizer.cpp
Line 154 (original), 169 (patched)
<https://reviews.apache.org/r/60764/#comment259441>

    Can you create a LinkedHashset (similar to LinkedHashmap) in stout which preserve the insertion order. this solves one issues about the ordering of the isolators is not preserved.
    
    I would at least add a TODO here (i do wish you can follow up :))



src/slave/containerizer/mesos/containerizer.cpp
Lines 182-184 (original), 203-208 (patched)
<https://reviews.apache.org/r/60764/#comment259442>

    The indentation should be like the following:
    ```
    switch (std::count_if(
        isolations->begin(),
        isolations->end(),
        [](...) {
        })) {
    }
    ```
    
    similar to what we did for other statements:
    ```
    int foo = func(
        param1,
        param2);
    ```


- Jie Yu


On July 11, 2017, 11:13 a.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60764/
> -----------------------------------------------------------
> 
> (Updated July 11, 2017, 11:13 a.m.)
> 
> 
> Review request for mesos, Qian Zhang and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7675
>     https://issues.apache.org/jira/browse/MESOS-7675
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Refactored the isolator dependency checks to immediately tokenize
> the isolator string, which makes it easier to check various consistency
> conditions.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/containerizer.cpp ff192bb085f3554ad1b1f20fb73bf827bf04ef13 
> 
> 
> Diff: https://reviews.apache.org/r/60764/diff/7/
> 
> 
> Testing
> -------
> 
> make check (Fedora 26)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 60764: Refactor isolator dependency checking.

Posted by Qian Zhang <zh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60764/#review180388
-----------------------------------------------------------




src/slave/containerizer/mesos/containerizer.cpp
Lines 151 (patched)
<https://reviews.apache.org/r/60764/#comment255534>

    No need `std::`



src/slave/containerizer/mesos/containerizer.cpp
Line 155 (original), 170 (patched)
<https://reviews.apache.org/r/60764/#comment255535>

    Kill this empty line.



src/slave/containerizer/mesos/containerizer.cpp
Line 181 (original), 203 (patched)
<https://reviews.apache.org/r/60764/#comment255541>

    Not yours. A period in the end.



src/slave/containerizer/mesos/containerizer.cpp
Lines 182-192 (original), 204-221 (patched)
<https://reviews.apache.org/r/60764/#comment255545>

    Can we merge the logic of these two `if` blocks? I mean:
    1. Get the count by calling `std::count_if()`.
    2. If the count > 1, error out.
    3. Else if the count == 0, do the insert.
    
    In this way, we do not need to call `strings::contains()` anymore.



src/slave/containerizer/mesos/containerizer.cpp
Lines 238 (patched)
<https://reviews.apache.org/r/60764/#comment255543>

    Ditto



src/slave/containerizer/mesos/containerizer.cpp
Lines 207-210 (original), 238-250 (patched)
<https://reviews.apache.org/r/60764/#comment255546>

    Ditto.


- Qian Zhang


On July 11, 2017, 7:13 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60764/
> -----------------------------------------------------------
> 
> (Updated July 11, 2017, 7:13 p.m.)
> 
> 
> Review request for mesos, Qian Zhang and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7675
>     https://issues.apache.org/jira/browse/MESOS-7675
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Refactor the isolator dependency checks to immediately tokenize the
> isolator string, which makes it easier to check various consistency
> conditions.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/containerizer.cpp 9376d14d66f5dc7e91c7c0e9da253f5eb9347539 
> 
> 
> Diff: https://reviews.apache.org/r/60764/diff/1/
> 
> 
> Testing
> -------
> 
> make check (Fedora 26)
> 
> 
> Thanks,
> 
> James Peach
> 
>