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

Function SendFramedMessageBlocking

be/src/kudu/rpc/blocking_ops.cc:56–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56Status SendFramedMessageBlocking(Socket* sock, const MessageLite& header, const MessageLite& msg,
57 const MonoTime& deadline) {
58 DCHECK(sock != nullptr);
59 DCHECK(header.IsInitialized()) << "header protobuf must be initialized";
60 DCHECK(msg.IsInitialized()) << "msg protobuf must be initialized";
61
62 // Ensure we are in blocking mode.
63 // These blocking calls are typically not in the fast path, so doing this for all build types.
64 RETURN_NOT_OK(CheckInBlockingMode(sock));
65
66 // Serialize message
67 faststring param_buf;
68 serialization::SerializeMessage(msg, &param_buf);
69
70 // Serialize header and initial length
71 faststring header_buf;
72 serialization::SerializeHeader(header, param_buf.size(), &header_buf);
73
74 // Write header & param to stream
75 size_t nsent;
76 RETURN_NOT_OK(sock->BlockingWrite(header_buf.data(), header_buf.size(), &nsent, deadline));
77 RETURN_NOT_OK(sock->BlockingWrite(param_buf.data(), param_buf.size(), &nsent, deadline));
78
79 return Status::OK();
80}
81
82Status ReceiveFramedMessageBlocking(Socket* sock, faststring* recv_buf,
83 MessageLite* header, Slice* param_buf, const MonoTime& deadline) {

Callers 4

SendNegotiatePBMethod · 0.85
SendErrorMethod · 0.85
SendNegotiatePBMethod · 0.85
SendConnectionContextMethod · 0.85

Calls 8

CheckInBlockingModeFunction · 0.85
SerializeMessageFunction · 0.85
SerializeHeaderFunction · 0.85
OKFunction · 0.85
BlockingWriteMethod · 0.80
IsInitializedMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected