github-actions[bot] commented on code in PR #26741:
URL: https://github.com/apache/doris/pull/26741#discussion_r1388956515
##########
be/src/io/fs/buffered_reader.cpp:
##########
@@ -167,9 +167,15 @@ Status MergeRangeFileReader::read_at_impl(size_t offset,
Slice result, size_t* b
}
}
size_t best_merged_size = 0;
- for (const std::pair<double, size_t>& rs : ratio_and_size) {
+ // Equivalent min size of each IO that can reach the maximum storage speed
limit:
+ // 512KB for oss, 4KB for hdfs
+ size_t min_size_per_io = _is_oss ? 512 * 1024 : 4 * 1024;
Review Comment:
warning: 512 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
size_t min_size_per_io = _is_oss ? 512 * 1024 : 4 * 1024;
^
```
##########
be/src/io/fs/buffered_reader.cpp:
##########
@@ -167,9 +167,15 @@
}
}
size_t best_merged_size = 0;
- for (const std::pair<double, size_t>& rs : ratio_and_size) {
+ // Equivalent min size of each IO that can reach the maximum storage speed
limit:
+ // 512KB for oss, 4KB for hdfs
+ size_t min_size_per_io = _is_oss ? 512 * 1024 : 4 * 1024;
Review Comment:
warning: 1024 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
size_t min_size_per_io = _is_oss ? 512 * 1024 : 4 * 1024;
^
```
##########
be/src/io/fs/buffered_reader.cpp:
##########
@@ -167,9 +167,15 @@
}
}
size_t best_merged_size = 0;
- for (const std::pair<double, size_t>& rs : ratio_and_size) {
+ // Equivalent min size of each IO that can reach the maximum storage speed
limit:
+ // 512KB for oss, 4KB for hdfs
+ size_t min_size_per_io = _is_oss ? 512 * 1024 : 4 * 1024;
Review Comment:
warning: 1024 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
size_t min_size_per_io = _is_oss ? 512 * 1024 : 4 * 1024;
^
```
--
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]