SteNicholas commented on code in PR #3461:
URL: https://github.com/apache/celeborn/pull/3461#discussion_r2328966405
##########
cpp/celeborn/network/TransportClient.cpp:
##########
@@ -79,6 +79,38 @@ void TransportClient::sendRpcRequestWithoutResponse(const
RpcRequest& request) {
}
}
+void TransportClient::pushDataAsync(
+ const PushData& pushData,
+ Timeout timeout,
+ std::shared_ptr<RpcResponseCallback> callback) {
+ try {
+ auto requestMsg = std::make_unique<PushData>(pushData);
+ auto future = dispatcher_->sendPushDataRequest(std::move(requestMsg));
+ std::move(future)
+ .within(timeout)
+ .thenValue(
+ [_callback = callback](std::unique_ptr<Message> responseMsg) {
+ if (responseMsg->type() == Message::RPC_RESPONSE) {
+ auto rpcResponse =
+ reinterpret_cast<RpcResponse*>(responseMsg.get());
+ _callback->onSuccess(rpcResponse->body());
+ } else {
+ _callback->onFailure(std::make_unique<std::runtime_error>(
+ "pushData return value type is not rpcResponse"));
+ }
+ })
+ .thenError([_callback = callback](const folly::exception_wrapper& e) {
+ _callback->onFailure(
+ std::make_unique<std::runtime_error>(e.what().toStdString()));
+ });
+
+ } catch (std::exception& e) {
+ auto errorMsg = fmt::format("pushData failed: {}", e.what());
Review Comment:
Could you add the `shuffleKey` and `partitionUniqueId` into `errorMsg`?
--
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]