You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Adam B <ad...@mesosphere.io> on 2016/04/10 09:53:36 UTC

Re: Review Request 44512: Support to get weights info by /weights.

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


Fix it, then Ship it!




Looks great! I'm testing a build now with the below suggestions, and will commit the patch if that succeeds.


docs/weights.md (line 25)
<https://reviews.apache.org/r/44512/#comment191416>

    Maybe name the anchor `#putRequest` to match the `#getRequest`



src/master/master.hpp (lines 1035 - 1041)
<https://reviews.apache.org/r/44512/#comment191417>

    I would switch the order here to alphabetize `get` before `put`, like you have in the cpp.



src/master/weights_handler.cpp (line 71)
<https://reviews.apache.org/r/44512/#comment191418>

    I wonder if `jsonify(weightInfos)` would work here


- Adam B


On March 22, 2016, 3:02 a.m., Yongqiao Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44512/
> -----------------------------------------------------------
> 
> (Updated March 22, 2016, 3:02 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4316
>     https://issues.apache.org/jira/browse/MESOS-4316
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Support to get weights info by /weights.
> 
> 
> Diffs
> -----
> 
>   docs/weights.md a94251340d5193c9474b2e5e85328d62fe4edd8f 
>   src/master/http.cpp bfea8fa811c24d37b2d7a8109728e1f40217e02f 
>   src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
>   src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 
> 
> Diff: https://reviews.apache.org/r/44512/diff/
> 
> 
> Testing
> -------
> 
> make && make check.
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  --authenticate_http --credentials=/opt/credentials.json  >> /tmp/mesos-master.log 2>&1 &)
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | python -mjson.tool
> []
> 
> $ curl --user framework1:secret_string1 --data "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]" -X PUT http://127.0.0.1:5050/weights
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | python -mjson.tool
> [
>         {
>             "role": "role3",
>             "weight": 3.4
>         },
>         {
>             "role": "role2",
>             "weight": 1.0
>         },
>         {
>             "role": "role1",
>             "weight": 1.8
>         }
> ]
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>


Re: Review Request 44512: Support to get weights info by /weights.

Posted by Adam B <ad...@mesosphere.io>.

> On April 10, 2016, 12:53 a.m., Adam B wrote:
> > src/master/weights_handler.cpp, line 71
> > <https://reviews.apache.org/r/44512/diff/2/?file=1309997#file1309997line71>
> >
> >     I wonder if `jsonify(weightInfos)` would work here

Nope. Nevermind.


- Adam


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


On March 22, 2016, 3:02 a.m., Yongqiao Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44512/
> -----------------------------------------------------------
> 
> (Updated March 22, 2016, 3:02 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4316
>     https://issues.apache.org/jira/browse/MESOS-4316
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Support to get weights info by /weights.
> 
> 
> Diffs
> -----
> 
>   docs/weights.md a94251340d5193c9474b2e5e85328d62fe4edd8f 
>   src/master/http.cpp bfea8fa811c24d37b2d7a8109728e1f40217e02f 
>   src/master/master.hpp 124d43931a5c8a00ee0aaa604feb1761795209f2 
>   src/master/weights_handler.cpp c9a1b0d9adbeb1e165999cdbb4f295b24f10b18f 
> 
> Diff: https://reviews.apache.org/r/44512/diff/
> 
> 
> Testing
> -------
> 
> make && make check.
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  --authenticate_http --credentials=/opt/credentials.json  >> /tmp/mesos-master.log 2>&1 &)
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | python -mjson.tool
> []
> 
> $ curl --user framework1:secret_string1 --data "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]" -X PUT http://127.0.0.1:5050/weights
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | python -mjson.tool
> [
>         {
>             "role": "role3",
>             "weight": 3.4
>         },
>         {
>             "role": "role2",
>             "weight": 1.0
>         },
>         {
>             "role": "role1",
>             "weight": 1.8
>         }
> ]
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>