csun5285 commented on code in PR #49232:
URL: https://github.com/apache/doris/pull/49232#discussion_r2011229444


##########
be/src/olap/rowset/rowset_writer.h:
##########
@@ -107,6 +108,14 @@ class RowsetWriter {
         }
         std::string segment_prefix 
{InvertedIndexDescriptor::get_index_file_path_prefix(
                 _context.segment_path(segment_id))};
+        if (_context.compaction_type == ReaderType::READER_BASE_COMPACTION &&
+            !config::inverted_index_ram_dir_enable_when_compaction) {
+            *index_file_writer = std::make_unique<InvertedIndexFileWriter>(
+                    _context.fs(), segment_prefix, 
_context.rowset_id.to_string(), segment_id,
+                    
_context.tablet_schema->get_inverted_index_storage_format(),
+                    std::move(idx_file_v2_ptr), false);
+            return Status::OK();
+        }
         *index_file_writer = std::make_unique<InvertedIndexFileWriter>(

Review Comment:
   `*index_file_writer = std::make_unique<InvertedIndexFileWriter>(
                       _context.fs(), segment_prefix, 
_context.rowset_id.to_string(), segment_id,
                       
_context.tablet_schema->get_inverted_index_storage_format(),
                       std::move(idx_file_v2_ptr), false, can_use_ram_dir);`



##########
be/src/olap/compaction.cpp:
##########
@@ -1088,6 +1088,7 @@ Status 
CompactionMixin::construct_output_rowset_writer(RowsetWriterContext& ctx)
     ctx.tablet_schema = _cur_tablet_schema;
     ctx.newest_write_timestamp = _newest_write_timestamp;
     ctx.write_type = DataWriteType::TYPE_COMPACTION;
+    ctx.compaction_type = compaction_type();

Review Comment:
   do the same thing in `CloudCompactionMixin::construct_output_rowset_writer`



##########
be/src/olap/rowset/rowset_writer.h:
##########
@@ -107,6 +108,14 @@ class RowsetWriter {
         }
         std::string segment_prefix 
{InvertedIndexDescriptor::get_index_file_path_prefix(
                 _context.segment_path(segment_id))};
+        if (_context.compaction_type == ReaderType::READER_BASE_COMPACTION &&
+            !config::inverted_index_ram_dir_enable_when_compaction) {
+            *index_file_writer = std::make_unique<InvertedIndexFileWriter>(
+                    _context.fs(), segment_prefix, 
_context.rowset_id.to_string(), segment_id,
+                    
_context.tablet_schema->get_inverted_index_storage_format(),
+                    std::move(idx_file_v2_ptr), false);
+            return Status::OK();
+        }
         *index_file_writer = std::make_unique<InvertedIndexFileWriter>(

Review Comment:
   `bool can_use_ram_dir = _context.compaction_type == 
ReaderType::READER_BASE_COMPACTION &&
               !config::inverted_index_ram_dir_enable_when_compaction;`



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

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


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

Reply via email to