| 168 | }; |
| 169 | struct { |
| 170 | Future<std::shared_ptr<RecordBatch>> operator()() { |
| 171 | auto state = state_; |
| 172 | return ::arrow::DeferNotOk( |
| 173 | state->io_executor->Submit([state]() -> Result<std::shared_ptr<RecordBatch>> { |
| 174 | if (state->first) { |
| 175 | ARROW_ASSIGN_OR_RAISE(auto task, state->iter.Next()); |
| 176 | ARROW_ASSIGN_OR_RAISE(state->curr_iter, task->Execute()); |
| 177 | state->first = false; |
| 178 | } |
| 179 | while (!IsIterationEnd(state->curr_iter)) { |
| 180 | ARROW_ASSIGN_OR_RAISE(auto next_batch, state->curr_iter.Next()); |
| 181 | if (IsIterationEnd(next_batch)) { |
| 182 | ARROW_ASSIGN_OR_RAISE(auto task, state->iter.Next()); |
| 183 | if (IsIterationEnd(task)) { |
| 184 | state->curr_iter = IterationEnd<RecordBatchIterator>(); |
| 185 | } else { |
| 186 | ARROW_ASSIGN_OR_RAISE(state->curr_iter, task->Execute()); |
| 187 | } |
| 188 | } else { |
| 189 | return next_batch; |
| 190 | } |
| 191 | } |
| 192 | return IterationEnd<std::shared_ptr<RecordBatch>>(); |
| 193 | })); |
| 194 | } |
| 195 | std::shared_ptr<IterState> state_; |
| 196 | } iter_to_gen{std::shared_ptr<IterState>( |
| 197 | new IterState{std::move(task_iter), {}, true, options->io_context.executor()})}; |
nothing calls this directly
no test coverage detected