zhannngchen commented on code in PR #47028:
URL: https://github.com/apache/doris/pull/47028#discussion_r1920190918


##########
be/src/cloud/cloud_tablet_mgr.cpp:
##########
@@ -419,4 +419,58 @@ void CloudTabletMgr::get_tablet_info(int64_t num_tablets, 
std::vector<TabletInfo
     }
 }
 
+void CloudTabletMgr::get_max_tablet_delete_bitmap_score(
+        uint64_t* max_delete_bitmap_score, uint64_t* 
max_base_rowset_delete_bitmap_score) {
+    int64_t max_delete_bitmap_score_tablet_id = 0;
+    int64_t max_base_rowset_delete_bitmap_score_tablet_id = 0;
+    auto handler = [&](const std::weak_ptr<CloudTablet>& tablet_wk) {
+        auto t = tablet_wk.lock();
+        if (!t) return;
+        uint64_t delete_bitmap_count =
+                
t.get()->tablet_meta()->delete_bitmap().get_delete_bitmap_count();
+        if (delete_bitmap_count > *max_delete_bitmap_score) {
+            max_delete_bitmap_score_tablet_id = t->tablet_id();
+            *max_delete_bitmap_score = delete_bitmap_count;
+        }
+        //get base rowset delete bitmap count
+        std::vector<RowsetSharedPtr> rowsets_;
+        std::string base_rowset_id_str;
+        {
+            std::shared_lock rowset_ldlock(t->get_header_lock());
+            for (const auto& it : t->rowset_map()) {
+                rowsets_.emplace_back(it.second);
+            }
+        }
+        std::sort(rowsets_.begin(), rowsets_.end(), Rowset::comparator);
+        if (!rowsets_.empty()) {
+            for (auto& rowset : rowsets_) {
+                if (rowset->rowset_meta()->total_disk_size() == 0) {
+                    continue;
+                }
+                base_rowset_id_str = rowset->rowset_id().to_string();

Review Comment:
   check the start version equals to 0 or 2



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