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