You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Mahler <bm...@apache.org> on 2020/01/30 21:31:34 UTC

Review Request 72064: Improved performance of v1 agent operator API GET_FRAMEWORKS call.

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

Review request for mesos, Andrei Sekretenko and Greg Mann.


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


Repository: mesos


Description
-------

This follow the same approach used for the master's v1 calls:

https://github.com/apache/mesos/commit/4f4dab961bd45ca444d13b831cdb
https://github.com/apache/mesos/commit/3dda3622f5ed01e8c132dc5ca594

That is, serializing directly to protobuf or json from the in-memory
v0 state.


Diffs
-----

  src/slave/http.hpp 0afdad9479f0cc2c94452b6b1f2289dd6ea01494 
  src/slave/http.cpp 04ad0d816618a1880913857a6f0ff38c4643c488 


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


Testing
-------

make check


Thanks,

Benjamin Mahler


Re: Review Request 72064: Improved performance of v1 agent operator API GET_FRAMEWORKS call.

Posted by Andrei Sekretenko <as...@mesosphere.io>.

> On Feb. 24, 2020, 7:26 p.m., Andrei Sekretenko wrote:
> > src/slave/http.cpp
> > Lines 1776 (patched)
> > <https://reviews.apache.org/r/72064/diff/2/?file=2210103#file2210103line1776>
> >
> >     I'm afraid this can mislead readers into thinking that `jsonifyGetFramework(...)` writes json on its own, whereas in reality it returns a lambda.
> >     
> >     Maybe some other name, like `getFrameworkElementWriter` or even `getJsonifyFramework` could be more transpatent?

Thinking of it again, readers should be more or less used to the convention that `jsonifySomething()` returns a lambda throughout the codebase. Looks like it's better to leave this as `jsonifyGetFramework()`.


- Andrei


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


On Jan. 30, 2020, 9:45 p.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72064/
> -----------------------------------------------------------
> 
> (Updated Jan. 30, 2020, 9:45 p.m.)
> 
> 
> Review request for mesos, Andrei Sekretenko and Greg Mann.
> 
> 
> Bugs: MESOS-10026
>     https://issues.apache.org/jira/browse/MESOS-10026
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This follow the same approach used for the master's v1 calls:
> 
> https://github.com/apache/mesos/commit/4f4dab961bd45ca444d13b831cdb
> https://github.com/apache/mesos/commit/3dda3622f5ed01e8c132dc5ca594
> 
> That is, serializing directly to protobuf or json from the in-memory
> v0 state.
> 
> 
> Diffs
> -----
> 
>   src/slave/http.hpp 0afdad9479f0cc2c94452b6b1f2289dd6ea01494 
>   src/slave/http.cpp 04ad0d816618a1880913857a6f0ff38c4643c488 
> 
> 
> Diff: https://reviews.apache.org/r/72064/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Re: Review Request 72064: Improved performance of v1 agent operator API GET_FRAMEWORKS call.

Posted by Andrei Sekretenko <as...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72064/#review219624
-----------------------------------------------------------


Fix it, then Ship it!





src/slave/http.cpp
Lines 1748 (patched)
<https://reviews.apache.org/r/72064/#comment307826>

    Does this lambda actually capture anything? If yes, then why is it safe to use it from the lambda returned by `jsonifyGetFrameworks`? If no, then I'd suggest to remove the default capture (s/[&]/[]/) for clarity.



src/slave/http.cpp
Lines 1753-1755 (patched)
<https://reviews.apache.org/r/72064/#comment307828>

    `int field = ...` ?



src/slave/http.cpp
Lines 1756 (patched)
<https://reviews.apache.org/r/72064/#comment307827>

    newline?



src/slave/http.cpp
Lines 1776 (patched)
<https://reviews.apache.org/r/72064/#comment307829>

    I'm afraid this can mislead readers into thinking that `jsonifyGetFramework(...)` writes json on its own, whereas in reality it returns a lambda.
    
    Maybe some other name, like `getFrameworkElementWriter` or even `getJsonifyFramework` could be more transpatent?


- Andrei Sekretenko


On Jan. 30, 2020, 9:45 p.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72064/
> -----------------------------------------------------------
> 
> (Updated Jan. 30, 2020, 9:45 p.m.)
> 
> 
> Review request for mesos, Andrei Sekretenko and Greg Mann.
> 
> 
> Bugs: MESOS-10026
>     https://issues.apache.org/jira/browse/MESOS-10026
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This follow the same approach used for the master's v1 calls:
> 
> https://github.com/apache/mesos/commit/4f4dab961bd45ca444d13b831cdb
> https://github.com/apache/mesos/commit/3dda3622f5ed01e8c132dc5ca594
> 
> That is, serializing directly to protobuf or json from the in-memory
> v0 state.
> 
> 
> Diffs
> -----
> 
>   src/slave/http.hpp 0afdad9479f0cc2c94452b6b1f2289dd6ea01494 
>   src/slave/http.cpp 04ad0d816618a1880913857a6f0ff38c4643c488 
> 
> 
> Diff: https://reviews.apache.org/r/72064/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Re: Review Request 72064: Improved performance of v1 agent operator API GET_FRAMEWORKS call.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72064/
-----------------------------------------------------------

(Updated Jan. 30, 2020, 9:45 p.m.)


Review request for mesos, Andrei Sekretenko and Greg Mann.


Changes
-------

- Fixed an accidental compilation issue.


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


Repository: mesos


Description
-------

This follow the same approach used for the master's v1 calls:

https://github.com/apache/mesos/commit/4f4dab961bd45ca444d13b831cdb
https://github.com/apache/mesos/commit/3dda3622f5ed01e8c132dc5ca594

That is, serializing directly to protobuf or json from the in-memory
v0 state.


Diffs (updated)
-----

  src/slave/http.hpp 0afdad9479f0cc2c94452b6b1f2289dd6ea01494 
  src/slave/http.cpp 04ad0d816618a1880913857a6f0ff38c4643c488 


Diff: https://reviews.apache.org/r/72064/diff/2/

Changes: https://reviews.apache.org/r/72064/diff/1-2/


Testing
-------

make check


Thanks,

Benjamin Mahler