| 3228 | } |
| 3229 | |
| 3230 | void CheckFileRead(int num_indices_pre_buffered) { |
| 3231 | auto expected_batches = LoadExpected(); |
| 3232 | const std::vector<io::ReadRange>& read_ranges = tracked_->get_read_ranges(); |
| 3233 | std::size_t starting_reads = read_ranges.size(); |
| 3234 | for (int i = 0; i < reader_->num_record_batches(); i++) { |
| 3235 | ASSERT_OK_AND_ASSIGN(auto next_batch, reader_->ReadRecordBatch(i)); |
| 3236 | AssertBatchesEqual(*expected_batches[i], *next_batch); |
| 3237 | } |
| 3238 | int metadata_reads = 0; |
| 3239 | int data_reads = 0; |
| 3240 | for (std::size_t i = starting_reads; i < read_ranges.size(); i++) { |
| 3241 | if (read_ranges[i].length > kMaxMetadataSizeBytes) { |
| 3242 | data_reads++; |
| 3243 | } else { |
| 3244 | metadata_reads++; |
| 3245 | } |
| 3246 | } |
| 3247 | // With ReadMessage optimization, non-prebuffered reads verify metadata and body |
| 3248 | // in a single large read, so we no longer see small metadata-only reads here. |
| 3249 | ASSERT_EQ(metadata_reads, 0); |
| 3250 | ASSERT_EQ(data_reads, reader_->num_record_batches()); |
| 3251 | } |
| 3252 | |
| 3253 | std::vector<std::shared_ptr<RecordBatch>> batches_; |
| 3254 | std::shared_ptr<Buffer> file_buffer_; |
nothing calls this directly
no test coverage detected