| 2622 | }; |
| 2623 | |
| 2624 | static int on_schema(struct ArrowAsyncDeviceStreamHandler* self, |
| 2625 | struct ArrowSchema* stream_schema) { |
| 2626 | auto* private_data = reinterpret_cast<PrivateData*>(self->private_data); |
| 2627 | if (self->producer != nullptr) { |
| 2628 | private_data->state_->producer_ = self->producer; |
| 2629 | private_data->state_->device_type_ = |
| 2630 | static_cast<DeviceAllocationType>(self->producer->device_type); |
| 2631 | } |
| 2632 | |
| 2633 | auto maybe_schema = ImportSchema(stream_schema); |
| 2634 | if (!maybe_schema.ok()) { |
| 2635 | private_data->fut_iterator_.MarkFinished(maybe_schema.status()); |
| 2636 | return EINVAL; |
| 2637 | } |
| 2638 | |
| 2639 | private_data->state_->schema_ = maybe_schema.MoveValueUnsafe(); |
| 2640 | private_data->fut_iterator_.MarkFinished(private_data->state_); |
| 2641 | self->producer->request(self->producer, |
| 2642 | static_cast<int64_t>(private_data->state_->queue_size_)); |
| 2643 | return 0; |
| 2644 | } |
| 2645 | |
| 2646 | static int on_next_task(ArrowAsyncDeviceStreamHandler* self, ArrowAsyncTask* task, |
| 2647 | const char* metadata) { |
no test coverage detected