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

Function IpcMessageHeaderSize

cpp/src/arrow/flight/serialization_internal.cc:630–646  ·  view source on GitHub ↗

Update the sizes of our Protobuf fields based on the given IPC payload.

Source from the content-addressed store, hash-verified

628
629// Update the sizes of our Protobuf fields based on the given IPC payload.
630arrow::Status IpcMessageHeaderSize(const arrow::ipc::IpcPayload& ipc_msg, bool has_body,
631 size_t* header_size, int32_t* metadata_size) {
632 DCHECK_LE(ipc_msg.metadata->size(), kInt32Max);
633 *metadata_size = static_cast<int32_t>(ipc_msg.metadata->size());
634
635 // 1 byte for metadata tag
636 *header_size += 1 + WireFormatLite::LengthDelimitedSize(*metadata_size);
637
638 // 2 bytes for body tag
639 if (has_body) {
640 // We write the body tag in the header but not the actual body data
641 *header_size += 2 + WireFormatLite::LengthDelimitedSize(ipc_msg.body_length) -
642 ipc_msg.body_length;
643 }
644
645 return arrow::Status::OK();
646}
647
648bool ReadBytesZeroCopy(const std::shared_ptr<Buffer>& source_data,
649 CodedInputStream* input, std::shared_ptr<Buffer>* out) {

Callers 1

Calls 2

OKFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected