A generator of record batches. All batches are yielded in order.
| 1308 | /// |
| 1309 | /// All batches are yielded in order. |
| 1310 | class WholeIpcFileRecordBatchGenerator { |
| 1311 | public: |
| 1312 | using Item = std::shared_ptr<RecordBatch>; |
| 1313 | |
| 1314 | explicit WholeIpcFileRecordBatchGenerator( |
| 1315 | std::shared_ptr<RecordBatchFileReaderImpl> state, |
| 1316 | std::shared_ptr<io::internal::ReadRangeCache> cached_source, |
| 1317 | const io::IOContext& io_context, arrow::internal::Executor* executor) |
| 1318 | : state_(std::move(state)), |
| 1319 | cached_source_(std::move(cached_source)), |
| 1320 | io_context_(io_context), |
| 1321 | executor_(executor), |
| 1322 | index_(0) {} |
| 1323 | |
| 1324 | Future<Item> operator()(); |
| 1325 | Future<std::shared_ptr<Message>> ReadBlock(const FileBlock& block); |
| 1326 | |
| 1327 | static Status ReadDictionaries( |
| 1328 | RecordBatchFileReaderImpl* state, |
| 1329 | std::vector<std::shared_ptr<Message>> dictionary_messages); |
| 1330 | static Result<std::shared_ptr<RecordBatch>> ReadRecordBatch( |
| 1331 | RecordBatchFileReaderImpl* state, Message* message); |
| 1332 | |
| 1333 | private: |
| 1334 | std::shared_ptr<RecordBatchFileReaderImpl> state_; |
| 1335 | std::shared_ptr<io::internal::ReadRangeCache> cached_source_; |
| 1336 | io::IOContext io_context_; |
| 1337 | arrow::internal::Executor* executor_; |
| 1338 | int index_; |
| 1339 | // Odd Future type, but this lets us use All() easily |
| 1340 | Future<> read_dictionaries_; |
| 1341 | }; |
| 1342 | |
| 1343 | /// A generator of record batches for use when reading |
| 1344 | /// a subset of columns from the file. |
no outgoing calls
no test coverage detected