yiguolei commented on code in PR #41968: URL: https://github.com/apache/doris/pull/41968#discussion_r1804653078
########## be/src/vec/sink/vdata_stream_sender.cpp: ########## @@ -166,210 +151,76 @@ Status PipChannel::send_broadcast_block(std::shared_ptr<BroadcastPBlockHolder>& return Status::OK(); } -Status PipChannel::send_current_block(bool eos, Status exec_status) { - if (Channel<pipeline::ExchangeSinkLocalState>::is_local()) { - return Channel<pipeline::ExchangeSinkLocalState>::send_local_block(exec_status, eos); - } - RETURN_IF_ERROR(send_remote_block(_pblock.release(), eos, exec_status)); - return Status::OK(); -} - -template <typename Parent> -Status Channel<Parent>::send_current_block(bool eos, Status exec_status) { - // FIXME: Now, local exchange will cause the performance problem is in a multi-threaded scenario - // so this feature is turned off here by default. We need to re-examine this logic +Status Channel::_send_current_block(bool eos, Status exec_status) { if (is_local()) { - return send_local_block(exec_status, eos); - } - if (eos) { - RETURN_IF_ERROR(_serializer.serialize_block(_ch_cur_pb_block, 1)); + return _send_local_block(exec_status, eos); } - RETURN_IF_ERROR(send_remote_block(_ch_cur_pb_block, eos, exec_status)); - ch_roll_pb_block(); - return Status::OK(); + return send_remote_block(std::move(_pblock), eos, exec_status); } -template <typename Parent> -Status Channel<Parent>::send_local_block(Status exec_status, bool eos) { +Status Channel::_send_local_block(Status exec_status, bool eos) { SCOPED_TIMER(_parent->local_send_timer()); Block block = _serializer.get_block()->to_block(); _serializer.get_block()->set_mutable_columns(block.clone_empty_columns()); Review Comment: 为什么要clone 一把 -- 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