gavinchou commented on code in PR #58567:
URL: https://github.com/apache/doris/pull/58567#discussion_r2579863870
##########
be/src/olap/compaction.cpp:
##########
@@ -1522,6 +1522,146 @@ int64_t CloudCompactionMixin::initiator() const {
return HashUtil::hash64(_uuid.data(), _uuid.size(), 0) &
std::numeric_limits<int64_t>::max();
}
+size_t
CloudCompactionMixin::truncate_rowsets_by_txn_size(std::vector<RowsetSharedPtr>&
rowsets,
+ int64_t&
estimated_size_bytes,
+ bool
enable_oplog_overhead,
+ int64_t&
rowset_meta_size_out,
+ int64_t&
delete_bitmap_size_out,
+ int64_t&
oplog_overhead_out) {
+ if (rowsets.empty()) {
+ estimated_size_bytes = 0;
+ rowset_meta_size_out = 0;
+ delete_bitmap_size_out = 0;
+ oplog_overhead_out = 0;
+ return 0;
+ }
+
+ const int64_t max_size = config::compaction_txn_max_size_bytes;
+ const double oplog_ratio = config::compaction_oplog_overhead_ratio;
+ const bool is_mow = _tablet->keys_type() == KeysType::UNIQUE_KEYS &&
+ _tablet->enable_unique_key_merge_on_write();
+
+ int64_t cumulative_meta_size = 0;
+ int64_t cumulative_delete_bitmap_size = 0;
+ int64_t cumulative_oplog_overhead = 0;
+ int64_t cumulative_total_size = 0;
+ size_t keep_count = 0;
+
+ for (size_t i = 0; i < rowsets.size(); ++i) {
+ const auto& rs = rowsets[i];
+
+ // 1. Estimate rowset meta PB size
+ int64_t rowset_meta_size =
rs->rowset_meta()->get_rowset_pb().ByteSizeLong();
Review Comment:
overlarge
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]