SWJTU-ZhangLei commented on code in PR #53801:
URL: https://github.com/apache/doris/pull/53801#discussion_r2266331626


##########
be/src/io/fs/hdfs_file_writer.cpp:
##########
@@ -146,13 +146,7 @@ HdfsFileWriter::HdfsFileWriter(Path path, 
std::shared_ptr<HdfsHandler> handler,
           _fs_name(std::move(fs_name)),
           _sync_file_data(opts ? opts->sync_file_data : true),
           _batch_buffer(MB * config::hdfs_write_batch_buffer_size_mb) {
-    if (config::enable_file_cache && opts != nullptr && 
opts->write_file_cache) {
-        _cache_builder = 
std::make_unique<FileCacheAllocatorBuilder>(FileCacheAllocatorBuilder {
-                opts ? opts->is_cold_data : false, opts ? 
opts->file_cache_expiration : 0,
-                BlockFileCache::hash(_path.filename().native()),
-                FileCacheFactory::instance()->get_by_path(
-                        BlockFileCache::hash(_path.filename().native()))});
-    }
+    init_cache_builder(opts, _path);

Review Comment:
   > 这个每次都会调用, 需要想办法 看下是不是在父类就完成, 不用每个子类都写一遍?
   
   <img width="1950" height="854" alt="image" 
src="https://github.com/user-attachments/assets/4033d5bf-7490-4a03-96bb-4aa32772affa";
 />
   <img width="2010" height="730" alt="image" 
src="https://github.com/user-attachments/assets/08568d1c-2d71-446b-bc8b-75763ff6854e";
 />
   
   @gavinchou 
这里因为类成员初始化在基类构造函数初始化之后初始化的原因,没有这样改动,否则需要提炼公共字段_path推到基类,改动较大,我建议就保持当前这个状态



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

Reply via email to