You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Guangya Liu <gy...@gmail.com> on 2015/11/05 08:25:55 UTC
Review Request 39968: Enable endpoint include nested paths
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/
-----------------------------------------------------------
Review request for mesos and Ben Mahler.
Bugs: MESOS-3833
https://issues.apache.org/jira/browse/MESOS-3833
Repository: mesos
Description
-------
Enable endpoint include nested paths
Diffs
-----
3rdparty/libprocess/src/help.cpp 3f82c0fb41a0d9388d88dbecc9289d705c2a343a
Diff: https://reviews.apache.org/r/39968/diff/
Testing
-------
Thanks,
Guangya Liu
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118819
-----------------------------------------------------------
Ship it!
Ship It!
- haosdent huang
On Feb. 11, 2016, 5:37 a.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Feb. 11, 2016, 5:37 a.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enabled http endpoint include nested paths.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
> 3rdparty/libprocess/src/tests/http_tests.cpp 410551cd4bda145bc491c46b1c64e6ed14fb4f13
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
> LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
> ### USAGE ###
> > /master/api/v1/scheduler
>
> ### TL;DR; ###
> Endpoint for schedulers to make Calls against the master.
>
> ### DESCRIPTION ###
> Returns 202 Accepted iff the request is accepted.
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118990
-----------------------------------------------------------
Ship it!
3rdparty/libprocess/src/tests/http_tests.cpp (lines 240 - 251)
<https://reviews.apache.org/r/39968/#comment180288>
Thanks!
- Ben Mahler
On Feb. 11, 2016, 5:37 a.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Feb. 11, 2016, 5:37 a.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enabled http endpoint include nested paths.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
> 3rdparty/libprocess/src/tests/http_tests.cpp 410551cd4bda145bc491c46b1c64e6ed14fb4f13
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
> LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
> ### USAGE ###
> > /master/api/v1/scheduler
>
> ### TL;DR; ###
> Endpoint for schedulers to make Calls against the master.
>
> ### DESCRIPTION ###
> Returns 202 Accepted iff the request is accepted.
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118838
-----------------------------------------------------------
Patch looks great!
Reviews applied: [43469, 39968]
Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh
- Mesos ReviewBot
On Feb. 11, 2016, 5:37 a.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Feb. 11, 2016, 5:37 a.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enabled http endpoint include nested paths.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
> 3rdparty/libprocess/src/tests/http_tests.cpp 410551cd4bda145bc491c46b1c64e6ed14fb4f13
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
> LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
> ### USAGE ###
> > /master/api/v1/scheduler
>
> ### TL;DR; ###
> Endpoint for schedulers to make Calls against the master.
>
> ### DESCRIPTION ###
> Returns 202 Accepted iff the request is accepted.
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by Guangya Liu <gy...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/
-----------------------------------------------------------
(Updated 二月 11, 2016, 5:37 a.m.)
Review request for mesos and Ben Mahler.
Bugs: MESOS-3833
https://issues.apache.org/jira/browse/MESOS-3833
Repository: mesos
Description
-------
Enabled http endpoint include nested paths.
Diffs (updated)
-----
3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
3rdparty/libprocess/src/tests/http_tests.cpp 410551cd4bda145bc491c46b1c64e6ed14fb4f13
Diff: https://reviews.apache.org/r/39968/diff/
Testing
-------
LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
### USAGE ###
> /master/api/v1/scheduler
### TL;DR; ###
Endpoint for schedulers to make Calls against the master.
### DESCRIPTION ###
Returns 202 Accepted iff the request is accepted.
Thanks,
Guangya Liu
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118671
-----------------------------------------------------------
3rdparty/libprocess/src/help.cpp (lines 170 - 187)
<https://reviews.apache.org/r/39968/#comment179969>
Please extend the existing HTTPTest.EndpointsHelp to also ensure that help requests with names containing a slash also function correctly.
3rdparty/libprocess/src/help.cpp (line 174)
<https://reviews.apache.org/r/39968/#comment179970>
This `api/v1/scheduler` example looks like a mesos endpoint and it doesn't seem necessary here, let's just omit it since this is libprocess. So:
```
// Path format of the url: /help/<id>[/<name>].
// Note that <name> may contain slashes.
```
3rdparty/libprocess/src/help.cpp (lines 175 - 176)
<https://reviews.apache.org/r/39968/#comment179971>
My previous suggestion was to continue to use strings::tokenize, but to add a parameter to specify the maximum number of tokens to return. So no need to trim:
```
vector<string> tokens = strings::tokenize(request.url.path, "/", 3);
```
You'll need to add another patch that implements the TODO here:
https://github.com/apache/mesos/blob/master/3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp#L134-L135
- Ben Mahler
On Feb. 10, 2016, 1:37 p.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Feb. 10, 2016, 1:37 p.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enabled http endpoint include nested paths.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
> LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
> ### USAGE ###
> > /master/api/v1/scheduler
>
> ### TL;DR; ###
> Endpoint for schedulers to make Calls against the master.
>
> ### DESCRIPTION ###
> Returns 202 Accepted iff the request is accepted.
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118727
-----------------------------------------------------------
Patch looks great!
Reviews applied: [39968]
Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh
- Mesos ReviewBot
On Feb. 10, 2016, 1:37 p.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Feb. 10, 2016, 1:37 p.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enabled http endpoint include nested paths.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
> LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
> ### USAGE ###
> > /master/api/v1/scheduler
>
> ### TL;DR; ###
> Endpoint for schedulers to make Calls against the master.
>
> ### DESCRIPTION ###
> Returns 202 Accepted iff the request is accepted.
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by Guangya Liu <gy...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/
-----------------------------------------------------------
(Updated 二月 10, 2016, 1:37 p.m.)
Review request for mesos and Ben Mahler.
Summary (updated)
-----------------
Enabled http endpoint include nested paths.
Bugs: MESOS-3833
https://issues.apache.org/jira/browse/MESOS-3833
Repository: mesos
Description (updated)
-------
Enabled http endpoint include nested paths.
Diffs (updated)
-----
3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
Diff: https://reviews.apache.org/r/39968/diff/
Testing (updated)
-------
LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
### USAGE ###
> /master/api/v1/scheduler
### TL;DR; ###
Endpoint for schedulers to make Calls against the master.
### DESCRIPTION ###
Returns 202 Accepted iff the request is accepted.
Thanks,
Guangya Liu
Re: Review Request 39968: Enable endpoint include nested paths
Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118622
-----------------------------------------------------------
3rdparty/libprocess/src/help.cpp (lines 120 - 131)
<https://reviews.apache.org/r/39968/#comment179913>
Did you test the help endpoints when you made this change? This code looks incorrect for `tokens.size() == 3`, how about we update tokenize to take the maximum number of tokens, like we did for strings::split?
```
// Path format of the url: /help/<id>[/<name>]
// Note that <name> may contain slashes.
vector<string> tokens = strings::tokenize(request.url.path, "/", 3);
Option<string> id = None();
Option<string> name = None();
if (tokens.size() > 1) {
id = tokens[1];
}
if (tokens.size() > 2) {
name = tokens[2];
}
```
- Ben Mahler
On Nov. 5, 2015, 7:25 a.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Nov. 5, 2015, 7:25 a.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enable endpoint include nested paths
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp 3f82c0fb41a0d9388d88dbecc9289d705c2a343a
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enabled http endpoint include nested paths.
Posted by Guangya Liu <gy...@gmail.com>.
> On 二月 10, 2016, 6:47 a.m., haosdent huang wrote:
> > 3rdparty/libprocess/src/help.cpp, line 124
> > <https://reviews.apache.org/r/39968/diff/1/?file=1116594#file1116594line124>
> >
> > I think could use
> > ```
> > strings::split(strings::trim(request.url.path, strings::ANY, "/"), "/", 3);
> > ```
> > to handle this part.
> > `tokens[1]` is always the id while `tokens[2]` is the name when `tokens.size() >= 3`.
Thanks haosdent, it does helps!
- Guangya
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118596
-----------------------------------------------------------
On 二月 10, 2016, 1:37 p.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated 二月 10, 2016, 1:37 p.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enabled http endpoint include nested paths.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp be3f7b74d92bd0626d111fd4ddd4cacd74e36e68
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
> LiuGuangyas-MacBook-Pro:~ gyliu$ curl "http://192.168.0.100:5050/help/master/api/v1/scheduler"
> ### USAGE ###
> > /master/api/v1/scheduler
>
> ### TL;DR; ###
> Endpoint for schedulers to make Calls against the master.
>
> ### DESCRIPTION ###
> Returns 202 Accepted iff the request is accepted.
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enable endpoint include nested paths
Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review118596
-----------------------------------------------------------
3rdparty/libprocess/src/help.cpp (line 122)
<https://reviews.apache.org/r/39968/#comment179876>
I think could use
```
strings::split(strings::trim(request.url.path, strings::ANY, "/"), "/", 3);
```
to handle this part.
`tokens[1]` is always the id while `tokens[2]` is the name when `tokens.size() >= 3`.
- haosdent huang
On Nov. 5, 2015, 7:25 a.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Nov. 5, 2015, 7:25 a.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enable endpoint include nested paths
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp 3f82c0fb41a0d9388d88dbecc9289d705c2a343a
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enable endpoint include nested paths
Posted by Guangya Liu <gy...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review105219
-----------------------------------------------------------
I'm not sure if this is a good solution or not, @Bmahler, please show your comments if any and I can update this RR based on your comments. Thanks!
- Guangya Liu
On 十一月 5, 2015, 7:25 a.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated 十一月 5, 2015, 7:25 a.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enable endpoint include nested paths
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp 3f82c0fb41a0d9388d88dbecc9289d705c2a343a
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Guangya Liu
>
>
Re: Review Request 39968: Enable endpoint include nested paths
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39968/#review105225
-----------------------------------------------------------
Patch looks great!
Reviews applied: [39968]
All tests passed.
- Mesos ReviewBot
On Nov. 5, 2015, 7:25 a.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39968/
> -----------------------------------------------------------
>
> (Updated Nov. 5, 2015, 7:25 a.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3833
> https://issues.apache.org/jira/browse/MESOS-3833
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Enable endpoint include nested paths
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/help.cpp 3f82c0fb41a0d9388d88dbecc9289d705c2a343a
>
> Diff: https://reviews.apache.org/r/39968/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Guangya Liu
>
>