| 84 | } |
| 85 | |
| 86 | Future<std::shared_ptr<io::RandomAccessFile>> FileSource::OpenAsync() const { |
| 87 | if (filesystem_) { |
| 88 | return filesystem_->OpenInputFileAsync(file_info_); |
| 89 | } |
| 90 | |
| 91 | if (buffer_) { |
| 92 | return Future<std::shared_ptr<io::RandomAccessFile>>::MakeFinished( |
| 93 | std::make_shared<io::BufferReader>(buffer_)); |
| 94 | } |
| 95 | |
| 96 | // TODO(GH-37962): custom_open_ should not block |
| 97 | return Future<std::shared_ptr<io::RandomAccessFile>>::MakeFinished(custom_open_()); |
| 98 | } |
| 99 | |
| 100 | int64_t FileSource::Size() const { |
| 101 | if (filesystem_) { |
no test coverage detected