yiguolei commented on code in PR #17261:
URL: https://github.com/apache/doris/pull/17261#discussion_r1120981441
##########
be/src/util/broker_storage_backend.cpp:
##########
@@ -72,14 +89,14 @@ Status BrokerStorageBackend::download(const std::string&
remote, const std::stri
constexpr size_t buf_sz = 1024 * 1024;
char read_buf[buf_sz];
size_t write_offset = 0;
- bool eof = false;
- while (!eof) {
- int64_t read_len = 0;
- RETURN_IF_ERROR(
- broker_reader->read(reinterpret_cast<uint8_t*>(read_buf),
buf_sz, &read_len, &eof));
-
- if (eof) {
- continue;
+ size_t cur_offset = 0;
+ while (true) {
+ size_t read_len = 0;
+ Slice file_slice(reinterpret_cast<uint8_t*>(read_buf), buf_sz);
+ RETURN_IF_ERROR(broker_reader->read_at(cur_offset, file_slice, io_ctx,
&read_len));
+ cur_offset += read_len;
+ if (read_len == 0) {
+ break;
}
if (read_len > 0) {
Review Comment:
This if is meaningless.
--
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]