platoneko commented on code in PR #18874: URL: https://github.com/apache/doris/pull/18874#discussion_r1188288103
########## be/src/runtime/load_channel.cpp: ########## @@ -84,6 +84,28 @@ Status LoadChannel::open(const PTabletWriterOpenRequest& params) { return Status::OK(); } +Status LoadChannel::open_partition(const PartitionOpenRequest& params) { + int64_t index_id = params.index_id(); + std::shared_ptr<TabletsChannel> channel; + { + std::lock_guard<std::mutex> l(_lock); + auto it = _tablets_channels.find(index_id); + if (it != _tablets_channels.end()) { + channel = it->second; + } else { + // create a new tablets channel + TabletsChannelKey key(params.id(), index_id); + channel.reset(new TabletsChannel(key, _load_id, _is_high_priority, _self_profile)); Review Comment: `std::make_shared<TabletsChannel>` is better -- 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