github-actions[bot] commented on code in PR #63789:
URL: https://github.com/apache/doris/pull/63789#discussion_r3315699147


##########
be/src/io/cache/fs_file_cache_storage.h:
##########
@@ -130,9 +132,29 @@ class FSFileCacheStorage : public FileCacheStorage {
                 count_inodes_override;
     };
     static void set_inode_estimation_test_hooks(InodeEstimationTestHooks* 
hooks);
+
+    void set_file_writer_for_test(const FileCacheKey& key, FileWriterPtr 
writer) {
+        auto file_writer_map_key = std::make_pair(key.hash, key.offset);
+        auto& shard = shard_of(file_writer_map_key);
+        std::lock_guard lock(shard.mtx);
+        shard.map[file_writer_map_key] = std::move(writer);
+    }
 #endif
 
 private:
+    struct WriterShard {
+        std::mutex mtx;
+        std::unordered_map<FileWriterMapKey, FileWriterPtr, 
FileWriterMapKeyHash> map;
+    };
+
+    static constexpr size_t kWriterShardNum = 1024; // must be power-of-2
+    static constexpr size_t kWriterShardMask = kWriterShardNum - 1;
+    static_assert((kWriterShardNum & kWriterShardMask) == 0);

Review Comment:
   This does not match the BE clang-format style: clang-format keeps spaces 
around the binary `&`. Since BE formatting is enforced, this will fail once 
`build-support/check-format.sh` runs with clang-format-16.
   
   ```suggestion
           return *_writer_shards[FileWriterMapKeyHash {}(k) & 
kWriterShardMask];
   ```



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