github-actions[bot] commented on code in PR #27720:
URL: https://github.com/apache/doris/pull/27720#discussion_r1421735558


##########
be/src/olap/wal_manager.h:
##########
@@ -15,6 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#pragma once
 #include <gen_cpp/PaloInternalService_types.h>

Review Comment:
   warning: 'gen_cpp/PaloInternalService_types.h' file not found 
[clang-diagnostic-error]
   ```cpp
   #include <gen_cpp/PaloInternalService_types.h>
            ^
   ```
   



##########
be/src/runtime/group_commit_mgr.cpp:
##########
@@ -450,4 +453,18 @@ Status GroupCommitMgr::get_load_block_queue(int64_t 
table_id, const TUniqueId& i
     }
     return group_commit_table->get_load_block_queue(instance_id, 
load_block_queue);
 }
+Status LoadBlockQueue::create_wal(int64_t db_id, int64_t tb_id, int64_t wal_id,
+                                  const std::string& import_label, WalManager* 
wal_manager,
+                                  std::vector<TSlotDescriptor>& slot_desc, int 
be_exe_version) {
+    _v_wal_writer = std::make_shared<vectorized::VWalWriter>(
+            db_id, tb_id, txn_id, label, wal_manager, slot_desc, 
be_exe_version);
+    return _v_wal_writer->init();
+}
+
+Status LoadBlockQueue::close_wal() {

Review Comment:
   warning: method 'close_wal' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/runtime/group_commit_mgr.h:59:
   ```diff
   -     Status close_wal();
   +     static Status close_wal();
   ```
   



##########
be/src/vec/sink/writer/vwal_writer.cpp:
##########
@@ -37,79 +36,50 @@
 #include "util/thrift_util.h"
 #include "vec/common/assert_cast.h"
 #include "vec/core/block.h"
-#include "vec/core/future_block.h"
 #include "vec/sink/vtablet_block_convertor.h"
 #include "vec/sink/vtablet_finder.h"
 
 namespace doris {
 namespace vectorized {
 
-VWalWriter::VWalWriter(int64_t db_id, int64_t tb_id, int64_t wal_id, 
RuntimeState* state,
-                       TupleDescriptor* output_tuple_desc)
+VWalWriter::VWalWriter(int64_t db_id, int64_t tb_id, int64_t wal_id,
+                       const std::string& import_label, WalManager* 
wal_manager,
+                       std::vector<TSlotDescriptor>& slot_desc, int 
be_exe_version)
         : _db_id(db_id),
           _tb_id(tb_id),
           _wal_id(wal_id),
-          _state(state),
-          _output_tuple_desc(output_tuple_desc) {}
+          _label(import_label),
+          _wal_manager(wal_manager),
+          _slot_descs(slot_desc),
+          _be_exe_version(be_exe_version) {}
 
 VWalWriter::~VWalWriter() {}
 
 Status VWalWriter::init() {
-    RETURN_IF_ERROR(_state->exec_env()->wal_mgr()->add_wal_path(_db_id, 
_tb_id, _wal_id,
-                                                                
_state->import_label()));
-    RETURN_IF_ERROR(_state->exec_env()->wal_mgr()->create_wal_writer(_wal_id, 
_wal_writer));
-    _state->exec_env()->wal_mgr()->add_wal_status_queue(_tb_id, _wal_id,
-                                                        
WalManager::WAL_STATUS::CREATE);
+    RETURN_IF_ERROR(_wal_manager->add_wal_path(_db_id, _tb_id, _wal_id, 
_label));
+    RETURN_IF_ERROR(_wal_manager->create_wal_writer(_wal_id, _wal_writer));
+    _wal_manager->add_wal_status_queue(_tb_id, _wal_id, 
WalManager::WAL_STATUS::CREATE);
     std::stringstream ss;
-    for (auto slot_desc : _output_tuple_desc->slots()) {
-        ss << std::to_string(slot_desc->col_unique_id()) << ",";
+    for (auto slot_desc : _slot_descs) {
+        if (slot_desc.col_unique_id < 0) {
+            continue;
+        }
+        ss << std::to_string(slot_desc.col_unique_id) << ",";
     }
     std::string col_ids = ss.str().substr(0, ss.str().size() - 1);
     RETURN_IF_ERROR(_wal_writer->append_header(_version, col_ids));
     return Status::OK();
 }
-Status VWalWriter::write_wal(OlapTableBlockConvertor* block_convertor,
-                             OlapTabletFinder* tablet_finder, 
vectorized::Block* block,
-                             RuntimeState* state, int64_t num_rows, int64_t 
filtered_rows) {
+
+Status VWalWriter::write_wal(vectorized::Block* block) {

Review Comment:
   warning: method 'write_wal' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/vec/sink/writer/vwal_writer.h:90:
   ```diff
   -     Status write_wal(vectorized::Block* block);
   +     static Status write_wal(vectorized::Block* block);
   ```
   



-- 
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

Reply via email to