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