Q1ngbo commented on code in PR #3197:
URL: https://github.com/apache/brpc/pull/3197#discussion_r3050557196


##########
src/brpc/policy/flatbuffers_protocol.cpp:
##########
@@ -0,0 +1,472 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "butil/logging.h"                       // LOG()
+#include "butil/iobuf.h"                         // butil::IOBuf
+#include "butil/single_iobuf.h"                  // butil::SingleIOBuf
+#include "butil/time.h"
+
+#include "butil/raw_pack.h"                      // RawPacker RawUnpacker
+
+#include "brpc/controller.h"                     // Controller
+#include "brpc/socket.h"                         // Socket
+#include "brpc/server.h"                         // Server
+#include "brpc/stream_impl.h"
+#include "brpc/rpc_dump.h"                       // SampledRequest
+#include "brpc/policy/most_common_message.h"
+#include "brpc/details/controller_private_accessor.h"
+#include "brpc/details/server_private_accessor.h"
+#include "brpc/policy/flatbuffers_protocol.h"
+
+namespace brpc {
+namespace policy {
+
+struct FBRpcRequestMeta {

Review Comment:
   
   
不太好实现。因为改用fbs定义meta部分后,需要通过FlatBufferBuilder构建meta,赋值时需要走flatbuffers的接口,这会有额外的处理开销。出于性能考虑,当前Meta字段与rpc
 message被放在了连续的内存中,使用FlatBufferBuilder创建meta时就无法使用该优化了。
   也无法直接使用flatc生成的meta struct,因为flatc会将成员变量属性设置为private,且只能通过特定接口访问成员变量。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to