eldenmoon commented on code in PR #39468:
URL: https://github.com/apache/doris/pull/39468#discussion_r1724284920
##########
be/src/service/internal_service.cpp:
##########
@@ -911,6 +911,48 @@ 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) {
+ auto pending_requests =
+
std::make_shared<std::atomic_int>(batchRequest->sub_key_lookup_req_size());
+ auto done_called = std::make_shared<std::atomic_bool>(false);
+ bool ret = _light_work_pool.try_offer([this, controller, batchRequest,
batchResponse, done,
+ pending_requests, done_called]() {
+ for (int i = 0; i < batchRequest->sub_key_lookup_req_size(); ++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 sub_ret = _light_work_pool.try_offer(
Review Comment:
too many tasks may lead to bad performance, not use thread pool here
--
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]