You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Anonymous Coward (Code Review)" <ge...@cloudera.org> on 2024/10/10 11:41:04 UTC
[kudu-CR] [WIP] Implement path parameter handling in webserver
lotzgabriella@gmail.com has uploaded this change for review. ( http://gerrit.cloudera.org:8080/21920
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
[WIP] Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic REST API endpoints.
Parameters within URIs are now identified using <parameter_name> notation.
Extracted parameters are passed to the WebRequest as path_params.
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
3 files changed, 71 insertions(+), 15 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/1
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 7: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/626/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 7
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Oct 2024 11:50:26 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 10: Code-Review+2
LGTM! Thank you for working on this!
Moreover congratulations on your first patch! To many more!
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 10
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Wed, 06 Nov 2024 08:56:23 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#5).
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Query parameter handling won't change with path parameters.
Example for query and path parameters:
Given path "api/v1/tables/<table_id>", we can reach URIs like
"api/v1/tables/1234?var1=1". We can find these in the following way,
assuming we have a WebRequest struct.
req.parsed_args["var1"] = "1"
req.path_params["table_id"] = "1234"
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/default_path_handlers.cc
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
5 files changed, 182 insertions(+), 16 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/5
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 5
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 9: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/643/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 9
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 31 Oct 2024 16:44:54 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 4:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/598/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 4
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 17 Oct 2024 14:38:55 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 6: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/618/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 6
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 28 Oct 2024 12:32:35 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 8:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/642/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 8
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 31 Oct 2024 13:50:50 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 10: Code-Review+1
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 10
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 04 Nov 2024 14:05:47 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Query parameter handling won't change with path parameters.
Example for query and path parameters:
Given path "api/v1/tables/<table_id>", we can reach URIs like
"api/v1/tables/1234?var1=1". We can find these in the following way,
assuming we have a WebRequest struct.
req.parsed_args["var1"] = "1"
req.path_params["table_id"] = "1234"
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Reviewed-on: http://gerrit.cloudera.org:8080/21920
Tested-by: Kudu Jenkins
Reviewed-by: Zoltan Chovan <zc...@cloudera.com>
Reviewed-by: Marton Greber <gr...@gmail.com>
---
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
4 files changed, 199 insertions(+), 18 deletions(-)
Approvals:
Kudu Jenkins: Verified
Zoltan Chovan: Looks good to me, but someone else must approve
Marton Greber: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 11
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 1:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/588/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 10 Oct 2024 11:41:12 +0000
Gerrit-HasComments: No
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 2:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/589/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 2
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Oct 2024 19:06:03 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 7: Code-Review+1
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 7
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Wed, 30 Oct 2024 06:28:25 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 9:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/643/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 9
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 31 Oct 2024 15:52:20 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Gabriella Lotz (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#10).
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Query parameter handling won't change with path parameters.
Example for query and path parameters:
Given path "api/v1/tables/<table_id>", we can reach URIs like
"api/v1/tables/1234?var1=1". We can find these in the following way,
assuming we have a WebRequest struct.
req.parsed_args["var1"] = "1"
req.path_params["table_id"] = "1234"
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
4 files changed, 199 insertions(+), 18 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/10
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 10
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] Implement path parameter handling in webserver
Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 4:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/21920/4/src/kudu/server/webserver-test.cc
File src/kudu/server/webserver-test.cc:
http://gerrit.cloudera.org:8080/#/c/21920/4/src/kudu/server/webserver-test.cc@668
PS4, Line 668: void PathParamHandler(const Webserver::WebRequest& req, Webserver::WebResponse* resp) {
: EasyJson* output = &resp->output;
: for (const auto& param : req.path_params) {
: (*output)[param.first] = param.second;
: }
: for (const auto& param : req.parsed_args) {
: (*output)[param.first] = param.second;
: }
: }
Can you please put some comments for this section.
For first time test readers it might be useful.
Something like: "this path param handler just gives back the params in .... this format etc"
http://gerrit.cloudera.org:8080/#/c/21920/4/src/kudu/server/webserver-test.cc@719
PS4, Line 719: TEST_F(PathParamWebserverTest, TestPathWithQueryString) {
: ASSERT_OK(curl_.FetchURL(
: Substitute("$0/api/tables/45dc8d192549427b8dca871dbbb20bb3?foo=bar", url_), &buf_));
: ASSERT_STR_CONTAINS(buf_.ToString(), "\"table_id\":\"45dc8d192549427b8dca871dbbb20bb3\"");
: ASSERT_STR_CONTAINS(buf_.ToString(), "\"foo\":\"bar\"");
: }
Is this what we are aiming for?
I mean this way what you get back is a map where you have path params and query params mixed, right?
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 4
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 17 Oct 2024 15:12:27 +0000
Gerrit-HasComments: Yes
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#3).
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
[WIP] Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/default_path_handlers.cc
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
5 files changed, 114 insertions(+), 15 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/3
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 3
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 3:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/593/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 3
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Wed, 16 Oct 2024 10:36:24 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#7).
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Query parameter handling won't change with path parameters.
Example for query and path parameters:
Given path "api/v1/tables/<table_id>", we can reach URIs like
"api/v1/tables/1234?var1=1". We can find these in the following way,
assuming we have a WebRequest struct.
req.parsed_args["var1"] = "1"
req.path_params["table_id"] = "1234"
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/default_path_handlers.cc
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
5 files changed, 184 insertions(+), 16 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/7
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 7
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
lotzgabriella@gmail.com has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 6:
(1 comment)
> Build Failed
>
> http://jenkins.kudu.apache.org/job/pre_commit/618/ : FAILURE
Failing tests seem flaky and unrelated to this change.
http://gerrit.cloudera.org:8080/#/c/21920/4/src/kudu/server/webserver-test.cc
File src/kudu/server/webserver-test.cc:
http://gerrit.cloudera.org:8080/#/c/21920/4/src/kudu/server/webserver-test.cc@719
PS4, Line 719: ASSERT_EQ("Remote error: HTTP 404", s.ToString());
: }
:
: // Test that the query string is correctly parsed and returned in the response,
: // even when the path contains a path parameter.
: T
> Is this what we are aiming for?
I created this testcase, so that we can test that the path parameter implementation doesn't interfere with query parameters, I realize now this could be confusing, so I am adding comments to explain.
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 6
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 28 Oct 2024 12:39:42 +0000
Gerrit-HasComments: Yes
[kudu-CR] Implement path parameter handling in webserver
Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 9:
(3 comments)
Just a couple nits.
http://gerrit.cloudera.org:8080/#/c/21920/9/src/kudu/server/webserver.h
File src/kudu/server/webserver.h:
http://gerrit.cloudera.org:8080/#/c/21920/9/src/kudu/server/webserver.h@190
PS9, Line 190: HasNonAscii
nit: maybe ContainsNonAscii is a bit better
http://gerrit.cloudera.org:8080/#/c/21920/9/src/kudu/server/webserver.cc
File src/kudu/server/webserver.cc:
http://gerrit.cloudera.org:8080/#/c/21920/9/src/kudu/server/webserver.cc@600
PS9, Line 600: has
nit: contains
http://gerrit.cloudera.org:8080/#/c/21920/9/src/kudu/server/webserver.cc@738
PS9, Line 738: segments.reserve(std::count(path.begin(), path.end(), '/') +
: 1); // Reserve space based on '/' count
nit: you can just keep the code in a single line and put the comment above it.
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 9
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 31 Oct 2024 16:44:44 +0000
Gerrit-HasComments: Yes
[kudu-CR] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#8).
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Query parameter handling won't change with path parameters.
Example for query and path parameters:
Given path "api/v1/tables/<table_id>", we can reach URIs like
"api/v1/tables/1234?var1=1". We can find these in the following way,
assuming we have a WebRequest struct.
req.parsed_args["var1"] = "1"
req.path_params["table_id"] = "1234"
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/default_path_handlers.cc
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
5 files changed, 202 insertions(+), 18 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/8
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 8
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] Implement path parameter handling in webserver
Posted by "Gabriella Lotz (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#9).
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Query parameter handling won't change with path parameters.
Example for query and path parameters:
Given path "api/v1/tables/<table_id>", we can reach URIs like
"api/v1/tables/1234?var1=1". We can find these in the following way,
assuming we have a WebRequest struct.
req.parsed_args["var1"] = "1"
req.path_params["table_id"] = "1234"
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
4 files changed, 199 insertions(+), 18 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/9
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 9
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 1: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/588/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Oct 2024 12:24:41 +0000
Gerrit-HasComments: No
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#2).
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
[WIP] Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/default_path_handlers.cc
M src/kudu/server/default_path_handlers.h
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
6 files changed, 119 insertions(+), 15 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/2
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 2
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 2: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/589/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 2
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Oct 2024 19:11:20 +0000
Gerrit-HasComments: No
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 1:
(4 comments)
looks good at a first glance, but needs tests
also some nits
http://gerrit.cloudera.org:8080/#/c/21920/1/src/kudu/server/webserver.cc
File src/kudu/server/webserver.cc:
http://gerrit.cloudera.org:8080/#/c/21920/1/src/kudu/server/webserver.cc@600
PS1, Line 600:
nit:whitespace
http://gerrit.cloudera.org:8080/#/c/21920/1/src/kudu/server/webserver.cc@611
PS1, Line 611: if (handler_segments[i][0] == '<' && handler_segments[i][handler_segments[i].size() - 1] == '>') {
nit:line too long
http://gerrit.cloudera.org:8080/#/c/21920/1/src/kudu/server/webserver.cc@612
PS1, Line 612:
nit:whitespace
http://gerrit.cloudera.org:8080/#/c/21920/1/src/kudu/server/webserver.cc@640
PS1, Line 640: handler = it->second;
nit:ident
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Oct 2024 12:49:33 +0000
Gerrit-HasComments: Yes
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 6: -Verified
Build Started http://jenkins.kudu.apache.org/job/pre_commit/618/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 6
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 28 Oct 2024 11:42:31 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 5:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/617/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 5
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 28 Oct 2024 10:20:41 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 10:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/651/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 10
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 04 Nov 2024 12:09:48 +0000
Gerrit-HasComments: No
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 2:
(4 comments)
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/default_path_handlers.cc
File src/kudu/server/default_path_handlers.cc:
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/default_path_handlers.cc@446
PS2, Line 446: PrerenderedWebResponse
Why does this need to be a PrerenderedWebResponse? Based on the output, there won't be any HTML code to be rendered.
Same for the next method.
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/default_path_handlers.cc@489
PS2, Line 489: RegisterPrerenderedPathHandler
Could this be simply RegisterPathHandler?
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/default_path_handlers.cc@491
PS2, Line 491: RegisterPrerenderedPathHandler
Could this be simply RegisterPathHandler?
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/webserver-test.cc
File src/kudu/server/webserver-test.cc:
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/webserver-test.cc@129
PS2, Line 129: AddTestPathHandlers(server_.get());
nit: keep the empty new line for spacing
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 2
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 14 Oct 2024 13:03:27 +0000
Gerrit-HasComments: Yes
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 4: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/598/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 4
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 17 Oct 2024 17:07:55 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 7:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/626/
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 7
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Oct 2024 10:32:52 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#4).
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/default_path_handlers.cc
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
5 files changed, 176 insertions(+), 16 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/4
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 4
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 10: Verified+1
Build Successful
http://jenkins.kudu.apache.org/job/pre_commit/651/ : SUCCESS
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 10
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 04 Nov 2024 13:05:12 +0000
Gerrit-HasComments: No
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 3: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/593/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 3
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Wed, 16 Oct 2024 11:30:39 +0000
Gerrit-HasComments: No
[kudu-CR] [WIP] Implement path parameter handling in webserver
Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: [WIP] Implement path parameter handling in webserver
......................................................................
Patch Set 2:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/default_path_handlers.h
File src/kudu/server/default_path_handlers.h:
http://gerrit.cloudera.org:8080/#/c/21920/2/src/kudu/server/default_path_handlers.h@36
PS2, Line 36: void AddTestPathHandlers(Webserver* webserver);
It might be better to create a test only path handler, to avoid webserver bloating.
There is an example already that creates a test webserver setup, and registeres a path handler:
https://github.com/apache/kudu/blob/446861c68cb3cc5e8ef8caaadf7d8eefc2ec1387/src/kudu/util/jwt-util-test.cc#L844-L898
I hope this helps.
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 2
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 14 Oct 2024 13:03:14 +0000
Gerrit-HasComments: Yes
[kudu-CR] Implement path parameter handling in webserver
Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 8:
(8 comments)
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/default_path_handlers.cc
File src/kudu/server/default_path_handlers.cc:
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/default_path_handlers.cc@443
PS7, Line 443:
nit: remove extra newline
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver-test.cc
File src/kudu/server/webserver-test.cc:
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver-test.cc@133
PS7, Line 133:
nit: remove extra newline
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver.cc
File src/kudu/server/webserver.cc:
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver.cc@596
PS7, Line 596: params
nit: you can call it path_params to make it easier to understand.
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver.cc@615
PS7, Line 615:
nit: start with match = false, and change the later assignments accordingly
(in general to avoid false positives while searching)
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver.cc@617
PS7, Line 617: std::vector<std::string> handler_segments = SplitPath(path_handler.first);
:
double check: maybe add a third condition that handler_segments[i].size() >= 3.
< and > are already 2 chars, for it to be a vaild segment identifier we need at least one more char.
or
you can just add a DCHEC() for this size checking before the if
.
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver.cc@619
PS7, Line 619: if (handler_segments.size() != uri_segments.size()) {
: continue;
nit: std:string param_name = handler_segments[i].substr(1, str.size() - 2)
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver.cc@728
PS7, Line 728: // Should we render with css styles?
since we are using c++17 if you fancy you can refactor this using string_views to make it more performant.
http://gerrit.cloudera.org:8080/#/c/21920/7/src/kudu/server/webserver.cc@732
PS7, Line 732: return SQ_HANDLED_OK;
: }
:
: std::
maybe it is better if we check this outside of SplitPath as its a different concern.
maybe before this line in the above section:
PathHandlerMap::const_iterator it = path_handlers_.find(request_info->uri);
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 8
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 31 Oct 2024 13:54:01 +0000
Gerrit-HasComments: Yes
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 8: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/642/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 8
Gerrit-Owner: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Thu, 31 Oct 2024 14:51:46 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Anonymous Coward (Code Review)" <ge...@cloudera.org>.
Hello Marton Greber, Zoltan Chovan, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/21920
to look at the new patch set (#6).
Change subject: Implement path parameter handling in webserver
......................................................................
Implement path parameter handling in webserver
Introduced path parameter parsing in the webserver to support dynamic
REST API endpoints. Parameters within URIs are now identified using
<parameter_name> notation. Extracted parameters are passed to the
WebRequest as path_params.
Example usage:
Registering a path like "/api/v1/tables/<table_id>" will map the
corresponding part of the URI to the table_id key in the path_params
of the WebRequest.
Query parameter handling won't change with path parameters.
Example for query and path parameters:
Given path "api/v1/tables/<table_id>", we can reach URIs like
"api/v1/tables/1234?var1=1". We can find these in the following way,
assuming we have a WebRequest struct.
req.parsed_args["var1"] = "1"
req.path_params["table_id"] = "1234"
Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
---
M src/kudu/server/default_path_handlers.cc
M src/kudu/server/webserver-test.cc
M src/kudu/server/webserver.cc
M src/kudu/server/webserver.h
M src/kudu/util/web_callback_registry.h
5 files changed, 182 insertions(+), 16 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/21920/6
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 6
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
[kudu-CR] Implement path parameter handling in webserver
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 5: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/617/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 5
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 28 Oct 2024 11:15:25 +0000
Gerrit-HasComments: No
[kudu-CR] Implement path parameter handling in webserver
Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has posted comments on this change. ( http://gerrit.cloudera.org:8080/21920 )
Change subject: Implement path parameter handling in webserver
......................................................................
Patch Set 6: Code-Review+1
(1 comment)
looks good overall, just one nit
http://gerrit.cloudera.org:8080/#/c/21920/6/src/kudu/server/webserver.h
File src/kudu/server/webserver.h:
http://gerrit.cloudera.org:8080/#/c/21920/6/src/kudu/server/webserver.h@185
PS6, Line 185: SplitPath
please add some comments about behaviour, that it only parses ascii characters and the return value when finding non-asscii chars
--
To view, visit http://gerrit.cloudera.org:8080/21920
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id2085c55d3b86985c87c5fd5a8b48568f8e6fa63
Gerrit-Change-Number: 21920
Gerrit-PatchSet: 6
Gerrit-Owner: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Oct 2024 08:28:50 +0000
Gerrit-HasComments: Yes