[ https://issues.apache.org/jira/browse/HADOOP-9151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537676#comment-13537676 ]
Binglin Chang commented on HADOOP-9151: --------------------------------------- bq. Not sure I understand this comment. Isn't the current byte[] coming from a protobuf message already? I mean for every rpc, there are already many new Proto objects created(C++ can reuse proto objects, but java can't...), the overhead may already way larger than buffer copies, so avoiding buffer copy may not help much. bq. Can you please explain how does the current proposal prevent this? There are 2 problems: 1. As you know, protobuf library doesn't provide non-blocking style method for reading varint length prefix, in order to handle rpc in a non-blocking style, I have to write my own version of non-blocking reading varint, in this scenario, 4 byte fix length prefix are more suitable for non-blocking io. 2. With every length prefix packet, I need 2 more callbacks to read length and read packet body, if each rpc call only have one request packet and one response packet, the code have much less callbacks. Since its already a fact, I just want it keep length prefix as few as possible. As I already finish the rpc code using the complex code, honestly I'm all OK with keeping compatibility or breaking it. But if we do want to break it, please consider the proposal more throughly, consider potential usage, make it high quality protocol. @Todd When I write async rpc client, The prefixed string(WritableUtils.readString) make -1(or MAX_UINT) to represent null string, this is a little annoying, introducing some special code to handle writable string. > Include RPC error info in RpcResponseHeader instead of sending it separately > ---------------------------------------------------------------------------- > > Key: HADOOP-9151 > URL: https://issues.apache.org/jira/browse/HADOOP-9151 > Project: Hadoop Common > Issue Type: Sub-task > Reporter: Sanjay Radia > Assignee: Sanjay Radia > Attachments: HADOOP-9151.patch > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira