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