platoneko commented on code in PR #18874: URL: https://github.com/apache/doris/pull/18874#discussion_r1185883787
########## be/src/runtime/tablets_channel.cpp: ########## @@ -270,6 +284,66 @@ int64_t TabletsChannel::mem_consumption() { return write_mem_usage + flush_mem_usage; } +template <typename TabletWriterAddRequest> +Status TabletsChannel::_open_all_writers_for_partition(const int64_t& tablet_id, + const TabletWriterAddRequest& request) { + std::vector<SlotDescriptor*>* index_slots = nullptr; + int32_t schema_hash = 0; + for (auto& index : _schema->indexes()) { + if (index->index_id == _index_id) { + index_slots = &index->slots; + schema_hash = index->schema_hash; + break; + } + } + if (index_slots == nullptr) { + std::stringstream ss; + ss << "unknown index id, key=" << _key << " tablet_id=" << tablet_id; + return Status::InternalError(ss.str()); + } + int64_t partition_id = _tablet_partition_map[tablet_id]; + DCHECK(partition_id != 0); + auto tablets = _partition_tablets_map[partition_id]; Review Comment: Consider `auto&` -- 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