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

Method on_schema

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

Source from the content-addressed store, hash-verified

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

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