yiguolei commented on code in PR #30746: URL: https://github.com/apache/doris/pull/30746#discussion_r1477194770
########## be/src/vec/exec/scan/vscan_node.h: ########## @@ -102,6 +102,35 @@ class ScannerDelegate { ScannerDelegate(ScannerDelegate&&) = delete; }; +class RunningScanner { +public: + RunningScanner(std::weak_ptr<ScannerDelegate> delegate_scanner, + vectorized::BlockUPtr free_block) + : scanner(delegate_scanner), current_block(std::move(free_block)) {} + + std::weak_ptr<ScannerDelegate> scanner; + // cache the block of current loop + vectorized::BlockUPtr current_block; + // whether current scanner is finished + bool eos = false; + // only take the size of the first block as estimated size + bool first_block = true; + uint64_t last_submit_time; // nanoseconds + Status status = Status::OK(); + + bool status_ok() { return status.ok() || status.is<ErrorCode::END_OF_FILE>(); } + + // reuse current running scanner + // reset `eos` and `status` + // `first_block` is used to update `_free_blocks_memory_usage`, and take the first block size + // as the `_estimated_block_size`. It has updated `_free_blocks_memory_usage`, so don't reset. + void reuse_scanner(std::weak_ptr<ScannerDelegate> next_scanner) { Review Comment: remove this method, it is too complex. It will only create one new block for one scanner. -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org