gavinchou commented on code in PR #42413:
URL: https://github.com/apache/doris/pull/42413#discussion_r1835746116


##########
cloud/src/meta-service/meta_service_http.cpp:
##########
@@ -331,6 +338,128 @@ static HttpResponse process_alter_iam(MetaServiceImpl* 
service, brpc::Controller
     return http_json_reply(resp.status());
 }
 
+static HttpResponse process_adjust_rate_limit(MetaServiceImpl* service, 
brpc::Controller* cntl) {
+    const auto& uri = cntl->http_request().uri();
+    auto qps_limit_str = std::string {http_query(uri, "qps_limit")};
+    auto rpc_name = std::string {http_query(uri, "rpc_name")};
+    auto instance_id = std::string {http_query(uri, "instance_id")};
+
+    auto process_invalid_arguments = [&]() -> HttpResponse {
+        return http_json_reply(MetaServiceCode::INVALID_ARGUMENT,
+                               fmt::format("invalid argument: 
qps_limit(required)={}, "
+                                           "rpc_name(optional)={}, 
instance_id(optional)={}",
+                                           qps_limit_str, rpc_name, 
instance_id));
+    };
+
+    static auto parse_qps_limit =

Review Comment:
   it seems that abuse using lambdas



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to