freemandealer commented on code in PR #12866:
URL: https://github.com/apache/doris/pull/12866#discussion_r980990083
##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -304,60 +397,76 @@ void
BetaRowsetWriter::find_longest_consecutive_small_segment(
is_terminated_by_big = true;
break;
} else {
- rename_compacted_segment_plain(_segcompacted_point);
- ++_segcompacted_point;
+
RETURN_NOT_OK(_rename_compacted_segment_plain(_segcompacted_point++));
}
} else {
let_big_terminate = true; // break if find a big after small
segments->push_back(seg);
- ++_segcompacted_point;
}
}
size_t s = segments->size();
if (!is_terminated_by_big && s <=
(config::segcompaction_threshold_segment_num / 2)) {
// start with big segments and end with small, better to do it in next
// round to compact more at once
- _segcompacted_point -= s;
segments->clear();
- LOG(INFO) << "candidate segments num too small:" << s;
- return;
+ return Status::OK();
}
if (s == 1) { // poor bachelor, let it go
LOG(INFO) << "only one candidate segment";
- rename_compacted_segment_plain(_segcompacted_point - 1);
+ RETURN_NOT_OK(_rename_compacted_segment_plain(_segcompacted_point++));
segments->clear();
- return;
+ return Status::OK();
}
std::stringstream ss;
for (auto& segment : (*segments.get())) {
ss << "[id:" << segment->id() << " num_rows:" << segment->num_rows()
<< "]";
}
LOG(INFO) << "candidate segments num:" << s << " list of candidates:" <<
ss.str();
+ return Status::OK();
}
-SegCompactionCandidatesSharedPtr
BetaRowsetWriter::get_segcompaction_candidates(bool is_last) {
- SegCompactionCandidatesSharedPtr segments =
std::make_shared<SegCompactionCandidates>();
+Status
BetaRowsetWriter::_get_segcompaction_candidates(SegCompactionCandidatesSharedPtr&
segments,
+ bool is_last) {
Review Comment:
indent
--
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]