github-actions[bot] commented on code in PR #26914:
URL: https://github.com/apache/doris/pull/26914#discussion_r1391280767
##########
be/src/vec/sink/vtablet_sink_v2.cpp:
##########
@@ -208,39 +256,44 @@ Status VOlapTableSinkV2::open(RuntimeState* state) {
signal::set_signal_task_id(_load_id);
_build_tablet_node_mapping();
- RETURN_IF_ERROR(_open_streams(state->backend_id()));
- _init_row_distribution();
+ RETURN_IF_ERROR(_open_streams(_backend_id));
+ RETURN_IF_ERROR(_init_row_distribution());
return Status::OK();
}
Status VOlapTableSinkV2::_open_streams(int64_t src_id) {
for (auto& [dst_id, _] : _tablets_for_node) {
- auto node_info = _nodes_info->find_node(dst_id);
- if (node_info == nullptr) {
- return Status::InternalError("Unknown node {} in tablet location",
dst_id);
- }
- std::shared_ptr<Streams> streams;
- streams =
ExecEnv::GetInstance()->load_stream_stub_pool()->get_or_create(
- _load_id, src_id, dst_id, _stream_per_node);
- // get tablet schema from each backend only in the 1st stream
- for (auto& stream : *streams | std::ranges::views::take(1)) {
- const std::vector<PTabletID>& tablets_for_schema =
_indexes_from_node[node_info->id];
-
RETURN_IF_ERROR(stream->open(_state->exec_env()->brpc_internal_client_cache(),
- *node_info, _txn_id, *_schema,
tablets_for_schema,
- _total_streams,
_state->enable_profile()));
- }
- // for the rest streams, open without getting tablet schema
- for (auto& stream : *streams | std::ranges::views::drop(1)) {
-
RETURN_IF_ERROR(stream->open(_state->exec_env()->brpc_internal_client_cache(),
- *node_info, _txn_id, *_schema, {},
_total_streams,
- _state->enable_profile()));
- }
+ auto streams =
ExecEnv::GetInstance()->load_stream_stub_pool()->get_or_create(
+ _load_id, src_id, dst_id, _stream_per_node, _num_local_sink);
+ RETURN_IF_ERROR(_open_streams_to_backend(dst_id, *streams));
_streams_for_node[dst_id] = streams;
}
return Status::OK();
}
+Status VOlapTableSinkV2::_open_streams_to_backend(int64_t dst_id,
+
::doris::stream_load::LoadStreams& streams) {
+ auto node_info = _nodes_info->find_node(dst_id);
Review Comment:
warning: 'auto node_info' can be declared as 'const auto *node_info'
[readability-qualified-auto]
```suggestion
const auto *node_info = _nodes_info->find_node(dst_id);
```
--
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]