You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/20 08:02:33 UTC

[GitHub] [doris] morningman commented on a diff in pull request #15175: [feature](new file reader) Integrate new file reader

morningman commented on code in PR #15175:
URL: https://github.com/apache/doris/pull/15175#discussion_r1053005459


##########
be/src/runtime/routine_load/data_consumer_group.cpp:
##########
@@ -96,8 +96,8 @@ Status KafkaDataConsumerGroup::start_all(StreamLoadContext* ctx) {
     int64_t left_rows = ctx->max_batch_rows;
     int64_t left_bytes = ctx->max_batch_size;
 
-    std::shared_ptr<KafkaConsumerPipe> kafka_pipe =
-            std::static_pointer_cast<KafkaConsumerPipe>(ctx->body_sink);
+    std::shared_ptr<io::KafkaConsumerPipeReader> kafka_pipe =

Review Comment:
   ```suggestion
       std::shared_ptr<io::KafkaConsumerPipe> kafka_pipe =
   ```



##########
be/src/io/fs/stream_load_pipe.cpp:
##########
@@ -132,25 +138,26 @@ Status StreamLoadPipeReader::_read_next_buffer(std::unique_ptr<uint8_t[]>* data,
     // finished
     if (_buf_queue.empty()) {
         DCHECK(_finished);
-        data->reset();
-        *length = 0;
+        // data->reset();
+        data = nullptr;
+        *bytes_read = 0;
         return Status::OK();
     }
     auto buf = _buf_queue.front();
-    *length = buf->remaining();
-    data->reset(new uint8_t[*length]);
-    buf->get_bytes((char*)(data->get()), *length);
+    *bytes_read = buf->remaining();
+    data = new char[*bytes_read];

Review Comment:
   Memory leak?



##########
be/src/util/hdfs_storage_backend.cpp:
##########
@@ -18,7 +18,6 @@
 #include "util/hdfs_storage_backend.h"
 

Review Comment:
   I think this class can be replaced by `hdfs_filesystem`?



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org