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 2022/10/17 03:12:53 UTC

[GitHub] [doris] yixiutt commented on a diff in pull request #12866: [enhancement](compaction) introduce segment compaction (#12609)

yixiutt commented on code in PR #12866:
URL: https://github.com/apache/doris/pull/12866#discussion_r996566742


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -31,20 +33,31 @@
 #include "olap/rowset/beta_rowset.h"
 #include "olap/rowset/rowset_factory.h"
 #include "olap/rowset/segment_v2/segment_writer.h"
-#include "olap/storage_engine.h"
+//#include "olap/storage_engine.h"
 #include "runtime/exec_env.h"
+#include "runtime/memory/mem_tracker_limiter.h"
 
 namespace doris {
 
+class StorageEngine;
+
 BetaRowsetWriter::BetaRowsetWriter()
         : _rowset_meta(nullptr),
           _num_segment(0),
+          _segcompacted_point(0),
+          _num_segcompacted(0),
           _segment_writer(nullptr),
           _num_rows_written(0),
           _total_data_size(0),
-          _total_index_size(0) {}
+          _total_index_size(0),
+          _raw_num_rows_written(0),
+          _is_doing_segcompaction(false) {
+    _segcompaction_status.store(OLAP_SUCCESS);
+}
 
 BetaRowsetWriter::~BetaRowsetWriter() {
+    OLAP_UNUSED_ARG(_wait_flying_segcompaction());

Review Comment:
   Is it necessary is destruct?



##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -102,6 +115,409 @@ Status BetaRowsetWriter::add_block(const vectorized::Block* block) {
     return _add_block(block, &_segment_writer);
 }
 
+vectorized::VMergeIterator* BetaRowsetWriter::_get_segcompaction_reader(

Review Comment:
   I recommend create a new file such as seg_compaction.cpp to handle segment compaction and logic in beta_rowset_writer could be much lightweight. In segment compaction, call init、do_impl、finish interface so that this code would be much clear to review



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