gavinchou commented on code in PR #53801:
URL: https://github.com/apache/doris/pull/53801#discussion_r2248330406


##########
be/src/io/fs/s3_file_writer.cpp:
##########
@@ -62,12 +62,19 @@ S3FileWriter::S3FileWriter(std::shared_ptr<ObjClientHolder> 
client, std::string
     s3_file_writer_total << 1;
     s3_file_being_written << 1;
     Aws::Http::SetCompliantRfc3986Encoding(true);
-    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(_obj_storage_path_opts.path.filename().native()),
-                FileCacheFactory::instance()->get_by_path(
-                        
BlockFileCache::hash(_obj_storage_path_opts.path.filename().native()))});
+
+    if (config::enable_file_cache && opts != nullptr) {
+        io::UInt128Wrapper path_hash =
+                
BlockFileCache::hash(_obj_storage_path_opts.path.filename().native());
+        BlockFileCache* file_cache_ptr = 
FileCacheFactory::instance()->get_by_path(path_hash);
+        if (opts->write_file_cache ||

Review Comment:
   too complex to read
   break the compound conditions down to several variables e.g.
   ```
   bool enable_cache_write = opt->write_file_cache;
   bool has_enought_file_cache_space = ...
   if (enable || has...) ...
   ```



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