| 1572 | } |
| 1573 | |
| 1574 | Status DoPreBufferMetadata(const std::vector<int>& indices) { |
| 1575 | RETURN_NOT_OK(CacheMetadata(indices)); |
| 1576 | RETURN_NOT_OK(EnsureDictionaryReadStarted()); |
| 1577 | Future<> all_metadata_ready = WaitForMetadatas(indices); |
| 1578 | for (int index : indices) { |
| 1579 | Future<std::shared_ptr<Message>> metadata_loaded = |
| 1580 | all_metadata_ready.Then([this, index]() -> Result<std::shared_ptr<Message>> { |
| 1581 | stats_.num_messages.fetch_add(1, std::memory_order_relaxed); |
| 1582 | ARROW_ASSIGN_OR_RAISE(FileBlock block, GetRecordBatchBlock(index)); |
| 1583 | ARROW_ASSIGN_OR_RAISE( |
| 1584 | std::shared_ptr<Buffer> metadata, |
| 1585 | metadata_cache_->Read({block.offset, block.metadata_length})); |
| 1586 | return ReadMessage(std::move(metadata), nullptr); |
| 1587 | }); |
| 1588 | cached_metadata_.emplace(index, metadata_loaded); |
| 1589 | } |
| 1590 | return Status::OK(); |
| 1591 | } |
| 1592 | |
| 1593 | std::vector<int> AllIndices() const { |
| 1594 | std::vector<int> all_indices(num_record_batches()); |
nothing calls this directly
no test coverage detected