MCPcopy Create free account
hub / github.com/apache/arrow / on_schema

Method on_schema

cpp/src/arrow/c/bridge.cc:2621–2641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 1

AsyncProducerMethod · 0.45

Calls 6

MoveValueUnsafeMethod · 0.80
ImportSchemaFunction · 0.70
okMethod · 0.45
MarkFinishedMethod · 0.45
statusMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected