| 2020 | } |
| 2021 | |
| 2022 | Future<std::shared_ptr<Message>> WholeIpcFileRecordBatchGenerator::ReadBlock( |
| 2023 | const FileBlock& block) { |
| 2024 | if (cached_source_) { |
| 2025 | auto cached_source = cached_source_; |
| 2026 | io::ReadRange range{block.offset, block.metadata_length + block.body_length}; |
| 2027 | auto pool = state_->options_.memory_pool; |
| 2028 | return cached_source->WaitFor({range}).Then( |
| 2029 | [cached_source, pool, range]() -> Result<std::shared_ptr<Message>> { |
| 2030 | ARROW_ASSIGN_OR_RAISE(auto buffer, cached_source->Read(range)); |
| 2031 | io::BufferReader stream(std::move(buffer)); |
| 2032 | return ReadMessage(&stream, pool); |
| 2033 | }); |
| 2034 | } else { |
| 2035 | return ReadMessageFromBlockAsync(block, state_->file_, io_context_); |
| 2036 | } |
| 2037 | } |
| 2038 | |
| 2039 | Result<std::shared_ptr<RecordBatch>> WholeIpcFileRecordBatchGenerator::ReadRecordBatch( |
| 2040 | RecordBatchFileReaderImpl* state, Message* message) { |
nothing calls this directly
no test coverage detected