SteNicholas commented on code in PR #513:
URL: https://github.com/apache/paimon-cpp/pull/513#discussion_r4492418603


##########
src/paimon/common/reader/prefetch_file_batch_reader_impl.cpp:
##########
@@ -348,19 +146,19 @@ Result<std::unique_ptr<PrefetchFileBatchReaderImpl>> 
PrefetchFileBatchReaderImpl
 PrefetchFileBatchReaderImpl::PrefetchFileBatchReaderImpl(
     const std::vector<std::shared_ptr<PrefetchFileBatchReader>>& readers, 
int32_t batch_size,
     uint32_t prefetch_queue_capacity, bool enable_adaptive_prefetch_strategy,
-    const std::shared_ptr<Executor>& executor, const 
std::shared_ptr<ReadAheadCache>& cache,
-    const std::shared_ptr<PrefetchIoMetricsState>& io_metrics, WarmupLevel 
warmup_level,
-    const std::shared_ptr<arrow::MemoryPool>& arrow_pool)
+    const std::shared_ptr<Executor>& executor, const 
std::shared_ptr<FileReadAhead>& read_ahead,
+    WarmupLevel warmup_level, const std::shared_ptr<arrow::MemoryPool>& 
arrow_pool)
     : readers_(std::move(readers)),
       batch_size_(batch_size),
       executor_(executor),
-      cache_(cache),
+      read_ahead_(read_ahead),
+      synchronous_reader_(
+          std::make_unique<WarmupFileBatchReader>(readers[0], read_ahead, 
warmup_level)),

Review Comment:
   **This new initializer blocks the `clang-debug-x86_64` CI job**: clang-tidy 
reports `bugprone-use-after-move` for `readers[0]` after 
`readers_(std::move(readers))` ([failing 
check](https://github.com/apache/paimon-cpp/actions/runs/42191598481/job/127804709857)).
 The parameter is a `const` reference, so that `std::move` actually copies the 
vector; this is not a runtime use-after-move today. Please make the copy 
explicit with `readers_(readers)` so the new access does not fail the 
repository's required static-analysis check.



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

Reply via email to