MCPcopy Create free account
hub / github.com/apache/impala / PopulateRequestPayload

Method PopulateRequestPayload

be/src/kudu/rpc/outbound_call.cc:168–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void RequestPayload::PopulateRequestPayload(const Message& req,
169 vector<unique_ptr<RpcSidecar>>&& sidecars) {
170 DCHECK_EQ(-1, sidecar_byte_size_);
171
172 sidecars_ = move(sidecars);
173 DCHECK_LE(sidecars_.size(), TransferLimits::kMaxSidecars);
174
175 // Compute total size of sidecar payload so that extra space can be reserved as part of
176 // the request body.
177 size_t message_size = req.ByteSizeLong();
178 CHECK_LE(message_size, std::numeric_limits<uint32_t>::max());
179 sidecar_byte_size_ = 0;
180 for (const unique_ptr<RpcSidecar>& car: sidecars_) {
181 header_.add_sidecar_offsets(sidecar_byte_size_ + message_size);
182 size_t sidecar_bytes = car->TotalSize();
183 DCHECK_LE(sidecar_byte_size_, TransferLimits::kMaxTotalSidecarBytes - sidecar_bytes);
184 sidecar_byte_size_ += sidecar_bytes;
185 }
186
187 serialization::SerializeMessage(req, &request_buf_, sidecar_byte_size_, true);
188}
189
190void OutboundCall::SetRequestPayload(const Message& req,
191 vector<unique_ptr<RpcSidecar>>&& sidecars) {

Callers 2

CreateRequestPayloadMethod · 0.80
SetRequestPayloadMethod · 0.80

Calls 5

moveFunction · 0.85
maxFunction · 0.85
SerializeMessageFunction · 0.85
sizeMethod · 0.45
TotalSizeMethod · 0.45

Tested by

no test coverage detected