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


##########
be/src/olap/wal/wal_dirs_info.cpp:
##########
@@ -50,20 +50,21 @@ void WalDirInfo::set_used(size_t used) {
     _used = used;
 }
 
-size_t WalDirInfo::get_pre_allocated() {
+size_t WalDirInfo::get_estimated_wal_bytes() {

Review Comment:
   warning: method 'get_estimated_wal_bytes' can be made const 
[readability-make-member-function-const]
   
   be/src/olap/wal/wal_dirs_info.h:43:
   ```diff
   -     size_t get_estimated_wal_bytes();
   +     size_t get_estimated_wal_bytes() const;
   ```
   
   ```suggestion
   size_t WalDirInfo::get_estimated_wal_bytes() const {
   ```
   



##########
be/src/runtime/group_commit_mgr.cpp:
##########
@@ -538,7 +534,7 @@ Status LoadBlockQueue::close_wal() {
     return Status::OK();
 }
 
-bool LoadBlockQueue::has_enough_wal_disk_space(size_t pre_allocated) {
+bool LoadBlockQueue::has_enough_wal_disk_space(size_t estimated_wal_bytes) {

Review Comment:
   warning: method 'has_enough_wal_disk_space' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/runtime/group_commit_mgr.h:73:
   ```diff
   -     bool has_enough_wal_disk_space(size_t estimated_wal_bytes);
   +     static bool has_enough_wal_disk_space(size_t estimated_wal_bytes);
   ```
   



##########
be/test/olap/wal/wal_dirs_info_test.cpp:
##########
@@ -57,31 +57,32 @@ class WalDirsInfoTest : public testing::Test {
         EXPECT_EQ(st, Status::OK());
         EXPECT_EQ(wal_dir_info->get_used(), used);
 
-        st = wal_dirs_info.update_wal_dir_pre_allocated(wal_dir, 
pre_allocated, 0);
+        st = wal_dirs_info.update_wal_dir_estimated_wal_bytes(wal_dir, 
estimated_wal_bytes, 0);
         EXPECT_EQ(st, Status::OK());
         st = wal_dirs_info.get_wal_dir_info(wal_dir, wal_dir_info);
         EXPECT_NE(wal_dir_info, nullptr);
         EXPECT_EQ(st, Status::OK());
-        EXPECT_EQ(wal_dir_info->get_pre_allocated(), pre_allocated);
+        EXPECT_EQ(wal_dir_info->get_estimated_wal_bytes(), 
estimated_wal_bytes);
 
-        st = wal_dirs_info.update_wal_dir_pre_allocated(wal_dir, 0, 
pre_allocated);
+        st = wal_dirs_info.update_wal_dir_estimated_wal_bytes(wal_dir, 0, 
estimated_wal_bytes);
         EXPECT_EQ(st, Status::OK());
         st = wal_dirs_info.get_wal_dir_info(wal_dir, wal_dir_info);
         EXPECT_NE(wal_dir_info, nullptr);
         EXPECT_EQ(st, Status::OK());
-        EXPECT_EQ(wal_dir_info->get_pre_allocated(), 0);
+        EXPECT_EQ(wal_dir_info->get_estimated_wal_bytes(), 0);
 
-        st = wal_dirs_info.update_wal_dir_pre_allocated(wal_dir, 
pre_allocated, 0);
+        st = wal_dirs_info.update_wal_dir_estimated_wal_bytes(wal_dir, 
estimated_wal_bytes, 0);
         EXPECT_EQ(st, Status::OK());
         st = wal_dirs_info.get_wal_dir_info(wal_dir, wal_dir_info);
         EXPECT_NE(wal_dir_info, nullptr);
         EXPECT_EQ(st, Status::OK());
-        EXPECT_EQ(wal_dir_info->get_pre_allocated(), pre_allocated);
+        EXPECT_EQ(wal_dir_info->get_estimated_wal_bytes(), 
estimated_wal_bytes);
 
-        EXPECT_EQ(wal_dir_info->available(), limit - used - pre_allocated);
+        EXPECT_EQ(wal_dir_info->available(), limit - used - 
estimated_wal_bytes);
     }
 
-    void set_and_check_fail(std::string wal_dir, size_t limit, size_t used, 
size_t pre_allocated) {
+    void set_and_check_fail(std::string wal_dir, size_t limit, size_t used,

Review Comment:
   warning: method 'set_and_check_fail' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void set_and_check_fail(std::string wal_dir, size_t limit, size_t 
used,
   ```
   



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