MCPcopy Create free account
hub / github.com/apache/brpc / ParseFromCompressedData

Function ParseFromCompressedData

src/brpc/compress.cpp:80–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80bool ParseFromCompressedData(const butil::IOBuf& data,
81 google::protobuf::Message* msg,
82 CompressType compress_type) {
83 if (compress_type == COMPRESS_TYPE_NONE) {
84 return ParsePbFromIOBuf(msg, data);
85 }
86 const CompressHandler* handler = FindCompressHandler(compress_type);
87 if (NULL == handler) {
88 return false;
89 }
90
91 Deserializer deserializer([msg](google::protobuf::io::ZeroCopyInputStream* input) {
92 return msg->ParseFromZeroCopyStream(input);
93 });
94 return handler->Decompress(data, &deserializer);
95}
96
97bool SerializeAsCompressedData(const google::protobuf::Message& msg,
98 butil::IOBuf* buf, CompressType compress_type) {

Callers 8

ProcessSofaRequestFunction · 0.85
ProcessSofaResponseFunction · 0.85
ParseRequestFromIOBufMethod · 0.85
ProcessHuluRequestFunction · 0.85
ProcessHuluResponseFunction · 0.85
ParseRequestFromIOBufMethod · 0.85
ProcessNovaResponseFunction · 0.85

Calls 2

ParsePbFromIOBufFunction · 0.85
FindCompressHandlerFunction · 0.85

Tested by

no test coverage detected