| 873 | } |
| 874 | |
| 875 | Status FlightPayload::Validate() const { |
| 876 | static constexpr int64_t kInt32Max = std::numeric_limits<int32_t>::max(); |
| 877 | if (descriptor && descriptor->size() > kInt32Max) { |
| 878 | return Status::CapacityError("Descriptor size overflow (>= 2**31)"); |
| 879 | } |
| 880 | if (app_metadata && app_metadata->size() > kInt32Max) { |
| 881 | return Status::CapacityError("app_metadata size overflow (>= 2**31)"); |
| 882 | } |
| 883 | if (ipc_message.body_length > kInt32Max) { |
| 884 | return Status::Invalid("Cannot send record batches exceeding 2GiB yet"); |
| 885 | } |
| 886 | return Status::OK(); |
| 887 | } |
| 888 | |
| 889 | arrow::Result<BufferVector> FlightPayload::SerializeToBuffers() const { |
| 890 | return internal::SerializePayloadToBuffers(*this); |
no test coverage detected