You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2023/01/12 08:55:09 UTC

[GitHub] [doris] platoneko commented on a diff in pull request #15633: [enhancement](compaction) Optimize calculating level size of input rowset in SizeBasedCumulativeCompactionPolicy

platoneko commented on code in PR #15633:
URL: https://github.com/apache/doris/pull/15633#discussion_r1067854490


##########
be/src/olap/cumulative_compaction_policy.cpp:
##########
@@ -335,13 +325,12 @@ int SizeBasedCumulativeCompactionPolicy::pick_input_rowsets(
     return transient_size;
 }
 
-int SizeBasedCumulativeCompactionPolicy::_level_size(const int64_t size) {
-    for (auto& i : _levels) {
-        if (size >= i) {
-            return i;
-        }
-    }
-    return 0;
+int64_t SizeBasedCumulativeCompactionPolicy::_level_size(const int64_t size) {
+    if (size < 1024) return 0;
+    int64_t max_level = (int64_t)1

Review Comment:
   Calculate the first 2 power number <= the given size.



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org