| 353 | class StreamingReaderImpl : public StreamingReader { |
| 354 | public: |
| 355 | StreamingReaderImpl(DecodedBlock first_block, AsyncGenerator<DecodedBlock> source, |
| 356 | const std::shared_ptr<DecodeContext>& context, int max_readahead) |
| 357 | : first_block_(std::move(first_block)), |
| 358 | schema_(first_block_->record_batch->schema()), |
| 359 | bytes_processed_(std::make_shared<std::atomic<int64_t>>(0)) { |
| 360 | // Set the final schema for future invocations of the source generator |
| 361 | context->SetStrictSchema(schema_); |
| 362 | if (max_readahead > 0) { |
| 363 | source = MakeReadaheadGenerator(std::move(source), max_readahead); |
| 364 | } |
| 365 | generator_ = MakeMappedGenerator( |
| 366 | std::move(source), [counter = bytes_processed_](const DecodedBlock& out) { |
| 367 | counter->fetch_add(out.num_bytes); |
| 368 | return out.record_batch; |
| 369 | }); |
| 370 | } |
| 371 | |
| 372 | static Future<std::shared_ptr<StreamingReaderImpl>> MakeAsync( |
| 373 | std::shared_ptr<DecodeContext> context, std::shared_ptr<io::InputStream> stream, |
nothing calls this directly
no test coverage detected