kangpinghuang commented on a change in pull request #516: Modify compaction 
code to be adapted to Rowset interface
URL: https://github.com/apache/incubator-doris/pull/516#discussion_r246370855
 
 

 ##########
 File path: be/src/olap/base_compaction.cpp
 ##########
 @@ -319,22 +306,30 @@ bool BaseCompaction::_check_whether_satisfy_policy(bool 
is_manual_trigger,
 }
 
 OLAPStatus BaseCompaction::_do_base_compaction(VersionHash 
new_base_version_hash,
-                                               vector<ColumnData*>* 
base_data_sources,
+                                               const vector<RowsetSharedPtr>& 
rowsets,
                                                uint64_t* row_count) {
     // 1. 生成新base文件对应的olap index
-    /*
-    SegmentGroup* new_base = new (std::nothrow) SegmentGroup(_tablet.get(),
-                                                       _new_base_version,
-                                                       new_base_version_hash,
-                                                       false, 0, 0);
-    */
-
-    SegmentGroup* new_base = nullptr;
-    if (new_base == NULL) {
-        OLAP_LOG_WARNING("fail to new SegmentGroup.");
+    RowsetId rowset_id = 0;
+    RowsetIdGenerator::instance()->get_next_id(_tablet->data_dir(), 
&rowset_id);
+    RowsetBuilderContext context = {_tablet->partition_id(), 
_tablet->tablet_id(),
+                                    _tablet->schema_hash(), rowset_id, 
+                                    RowsetTypePB::ALPHA_ROWSET, 
_tablet->rowset_path_prefix(),
+                                    _tablet->tablet_schema(), 
_tablet->num_key_fields(),
+                                    _tablet->num_short_key_fields(), 
_tablet->num_rows_per_row_block(),
+                                    _tablet->compress_kind(), 
_tablet->bloom_filter_fpp()};
+    RowsetBuilder* builder = new AlphaRowsetBuilder(); 
+    builder->init(context);
+    if (builder == nullptr) {
 
 Review comment:
   move the judgement up before builder->init

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org
For additional commands, e-mail: dev-h...@doris.apache.org

Reply via email to