eldenmoon commented on code in PR #39468:
URL: https://github.com/apache/doris/pull/39468#discussion_r1746494336
##########
be/src/service/internal_service.cpp:
##########
@@ -912,6 +912,34 @@ void
PInternalService::tablet_fetch_data(google::protobuf::RpcController* contro
}
}
+void
PInternalService::tablet_batch_fetch_data(google::protobuf::RpcController*
controller,
+ const
PTabletBatchKeyLookupRequest* batchRequest,
+ PTabletBatchKeyLookupResponse*
batchResponse,
+ google::protobuf::Closure*
done) {
+ int request_count = batchRequest->sub_key_lookup_req_size();
+ auto pending_requests = std::make_shared<std::atomic<int>>(request_count);
+ batchResponse->mutable_sub_key_lookup_res()->Reserve(request_count);
+ [[maybe_unused]] auto* cntl = static_cast<brpc::Controller*>(controller);
+ for (int i = 0; i < request_count; ++i) {
+ batchResponse->add_sub_key_lookup_res();
+ const PTabletKeyLookupRequest* request =
&batchRequest->sub_key_lookup_req(i);
+ PTabletKeyLookupResponse* response =
batchResponse->mutable_sub_key_lookup_res(i);
+ bool ret = _light_work_pool.try_offer([this, request, response, done,
pending_requests]() {
Review Comment:
not add too many keys to _light_work_pool, only add this for loop to task
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]