w41ter commented on code in PR #39208:
URL: https://github.com/apache/doris/pull/39208#discussion_r1713439553


##########
cloud/src/meta-service/meta_service_http.cpp:
##########
@@ -350,6 +355,70 @@ static HttpResponse process_get_value(MetaServiceImpl* 
service, brpc::Controller
     return process_http_get_value(service->txn_kv().get(), 
ctrl->http_request().uri());
 }
 
+// show all key ranges and their count.
+static HttpResponse process_show_meta_ranges(MetaServiceImpl* service, 
brpc::Controller* ctrl) {
+    auto txn_kv = std::dynamic_pointer_cast<FdbTxnKv>(service->txn_kv());
+    if (!txn_kv) {
+        return http_json_reply(MetaServiceCode::INVALID_ARGUMENT,
+                               "this method only support fdb txn kv");
+    }
+
+    std::vector<std::string> partition_boundaries;
+    TxnErrorCode code = 
txn_kv->get_partition_boundaries(&partition_boundaries);
+    if (code != TxnErrorCode::TXN_OK) {
+        auto msg = fmt::format("failed to get boundaries, code={}", code);
+        return http_json_reply(MetaServiceCode::UNDEFINED_ERR, msg);
+    }
+
+    std::unordered_map<std::string, size_t> partition_count;

Review Comment:
   No comment is needed here, partition is a very basic concept.



-- 
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