chenlinzhong commented on code in PR #9804:
URL: https://github.com/apache/incubator-doris/pull/9804#discussion_r885681272


##########
be/src/olap/compaction.cpp:
##########
@@ -55,6 +55,25 @@ Status Compaction::execute_compact() {
     return st;
 }
 
+Status Compaction::samll_rowsets_compact() {
+    std::unique_lock<std::mutex> 
lock(_tablet->get_cumulative_compaction_lock(), std::try_to_lock);
+    if (!lock.owns_lock()) {
+        LOG(INFO) << "The tablet is under cumulative compaction. tablet=" << 
_tablet->full_name();
+        return Status::OLAPInternalError(OLAP_ERR_CE_TRY_CE_LOCK_ERROR);
+    }
+    _input_rowsets.clear();
+    int vertion_count = _tablet->version_count();

Review Comment:
   > 
   
   fixed



##########
be/src/olap/compaction.cpp:
##########
@@ -55,6 +55,25 @@ Status Compaction::execute_compact() {
     return st;
 }
 
+Status Compaction::samll_rowsets_compact() {
+    std::unique_lock<std::mutex> 
lock(_tablet->get_cumulative_compaction_lock(), std::try_to_lock);
+    if (!lock.owns_lock()) {
+        LOG(INFO) << "The tablet is under cumulative compaction. tablet=" << 
_tablet->full_name();
+        return Status::OLAPInternalError(OLAP_ERR_CE_TRY_CE_LOCK_ERROR);
+    }
+    _input_rowsets.clear();
+    int vertion_count = _tablet->version_count();
+    int64_t now = UnixMillis();
+    _tablet->pick_samll_verson_rowsets(&_input_rowsets);
+    if (_input_rowsets.size() >= 5) {
+        do_compaction(0);
+        LOG(INFO) << "samll_rowsets_compact,before_versions:" << vertion_count

Review Comment:
   > 
   
   fixed



##########
be/src/olap/tablet.cpp:
##########
@@ -839,10 +839,53 @@ void Tablet::calculate_cumulative_point() {
     if (ret_cumulative_point == K_INVALID_CUMULATIVE_POINT) {
         return;
     }
-
     set_cumulative_layer_point(ret_cumulative_point);
 }
 
+//1.小版本rowset
+//2.不改变cp,cp值的更新有cc任务来执行
+//3.找到最大的,连续小版本rowset
+Status Tablet::pick_samll_verson_rowsets(std::vector<RowsetSharedPtr>* 
input_rowsets) {
+    int max_series_num = 1000;
+    int max_rows = config::small_version_max_rows;
+    if (max_rows <= 0) return Status::OK();
+    std::vector<std::vector<RowsetSharedPtr>> 
samll_version_rowsets(max_series_num);
+    int idx = 0;
+    bool is_bad = false;

Review Comment:
   > Unused variable?
   
   fixed



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