github-actions[bot] commented on code in PR #29183: URL: https://github.com/apache/doris/pull/29183#discussion_r1437061967
########## be/src/http/action/http_stream.cpp: ########## @@ -387,6 +387,66 @@ Status HttpStreamAction::_process_put(HttpRequest* http_req, return _exec_env->stream_load_executor()->execute_plan_fragment(ctx); } +Status HttpStreamAction::process_wal_relay(ExecEnv* exec_env, int64_t wal_id, std::string& sql_str, Review Comment: warning: method 'process_wal_relay' can be made static [readability-convert-member-functions-to-static] ```suggestion static Status HttpStreamAction::process_wal_relay(ExecEnv* exec_env, int64_t wal_id, std::string& sql_str, ``` ########## be/src/olap/wal_info.cpp: ########## @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/wal_info.h" +namespace doris { +WalInfo::WalInfo(std::string wal_path, int64_t retry_num, int64_t start_time_ms, bool relaying) Review Comment: warning: pass by value and use std::move [modernize-pass-by-value] be/src/olap/wal_info.cpp:18: ```diff - namespace doris { + + #include <utility> + namespace doris { ``` be/src/olap/wal_info.cpp:20: ```diff - : _wal_path(wal_path), + : _wal_path(std::move(wal_path)), ``` ########## be/src/olap/wal_info.cpp: ########## @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/wal_info.h" +namespace doris { +WalInfo::WalInfo(std::string wal_path, int64_t retry_num, int64_t start_time_ms, bool relaying) + : _wal_path(wal_path), + _retry_num(retry_num), + _start_time_ms(start_time_ms), + _relaying(relaying) {} +WalInfo::~WalInfo() {} +std::string WalInfo::get_wal_path() { + return _wal_path; +} +int64_t WalInfo::get_retry_num() { + return _retry_num; +} +int64_t WalInfo::get_start_time_ms() { Review Comment: warning: method 'get_start_time_ms' can be made const [readability-make-member-function-const] ```suggestion int64_t WalInfo::get_start_time_ms() const { ``` be/src/olap/wal_info.h:25: ```diff - int64_t get_start_time_ms(); + int64_t get_start_time_ms() const; ``` ########## be/src/olap/wal_info.cpp: ########## @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/wal_info.h" +namespace doris { +WalInfo::WalInfo(std::string wal_path, int64_t retry_num, int64_t start_time_ms, bool relaying) + : _wal_path(wal_path), + _retry_num(retry_num), + _start_time_ms(start_time_ms), + _relaying(relaying) {} +WalInfo::~WalInfo() {} +std::string WalInfo::get_wal_path() { + return _wal_path; +} +int64_t WalInfo::get_retry_num() { + return _retry_num; +} +int64_t WalInfo::get_start_time_ms() { + return _start_time_ms; +} +bool WalInfo::get_relaying() { Review Comment: warning: method 'get_relaying' can be made const [readability-make-member-function-const] ```suggestion bool WalInfo::get_relaying() const { ``` be/src/olap/wal_info.h:27: ```diff - bool get_relaying(); + bool get_relaying() const; ``` ########## be/src/olap/wal_info.cpp: ########## @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/wal_info.h" +namespace doris { +WalInfo::WalInfo(std::string wal_path, int64_t retry_num, int64_t start_time_ms, bool relaying) + : _wal_path(wal_path), + _retry_num(retry_num), + _start_time_ms(start_time_ms), + _relaying(relaying) {} +WalInfo::~WalInfo() {} +std::string WalInfo::get_wal_path() { + return _wal_path; +} +int64_t WalInfo::get_retry_num() { Review Comment: warning: method 'get_retry_num' can be made const [readability-make-member-function-const] ```suggestion int64_t WalInfo::get_retry_num() const { ``` be/src/olap/wal_info.h:24: ```diff - int64_t get_retry_num(); + int64_t get_retry_num() const; ``` ########## be/src/olap/wal_info.cpp: ########## @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "olap/wal_info.h" +namespace doris { +WalInfo::WalInfo(std::string wal_path, int64_t retry_num, int64_t start_time_ms, bool relaying) + : _wal_path(wal_path), + _retry_num(retry_num), + _start_time_ms(start_time_ms), + _relaying(relaying) {} +WalInfo::~WalInfo() {} Review Comment: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] ```suggestion WalInfo::~WalInfo() = default; ``` ########## be/src/olap/wal_table.h: ########## @@ -26,31 +26,37 @@ #include "gen_cpp/HeartbeatService_types.h" #include "runtime/exec_env.h" #include "runtime/stream_load/stream_load_context.h" +#include "olap/wal_info.h" namespace doris { class WalTable { public: WalTable(ExecEnv* exec_env, int64_t db_id, int64_t table_id); ~WalTable(); // used when be start and there are wals need to do recovery void add_wals(std::vector<std::string> wals); + void pick_relay_wals(); Status replay_wals(); size_t size(); void stop(); public: - // <retry_num, start_time_ms, is_doing_replay> - using replay_wal_info = std::tuple<int64_t, int64_t, bool>; + // <column_name, column_index> + using column_info = std::pair<std::string, int64_t>; private: - Status _get_wal_info(const std::string& wal, std::shared_ptr<std::pair<int64_t, std::string>>&); - std::string _get_tmp_path(const std::string wal); - Status _send_request(int64_t wal_id, const std::string& wal, const std::string& label); - Status _abort_txn(int64_t db_id, int64_t wal_id); + Status _parse_wal_path(const std::string& wal, std::shared_ptr<std::pair<int64_t, std::string>>&); + bool _rename_to_tmp_path(const std::string wal); + Status _replay_one_txn_with_stremaload(int64_t wal_id, const std::string& wal, + const std::string& label); Review Comment: warning: parameter 'wal' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls] ```suggestion bool _rename_to_tmp_path(std::string wal); ``` -- 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