[ 
https://issues.apache.org/jira/browse/HTRACE-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14533211#comment-14533211
 ] 

Colin Patrick McCabe commented on HTRACE-164:
---------------------------------------------

bq. Take this example: You ship this code. Then we want to add the ability to 
ship incomplete spans ( Something that really happens in real world tracing ) 
So end ms needs to be optional. start ms need to be optional too The code 
creating the bytes to write on the wire now needs to be changed by hand. 
Different and de-coupled code on the server now needs to be changed to 
understand that end_ms is optional

{{start_ms}} and {{end_ms}} already are optional in the current patch.  msgpack 
sends a map.  If the 'b' key is not present, then {{begin_ms}} defaults to 0.  
Similarly with 'e'.  The same is true for all the span fields.  They are all 
optional at the RPC level.

bq. Or let say we want to add the ability to respond with if a span is durably 
written somewhere. Or we want to respond with result saying to sample fewer 
traces. Or we want to have the client able to set a trace as interesting after 
it's completed.

If we want to add any of those things, we can add this to the 
{{WriteSpansResp}} message in a backwards-compatible fashion.  It's no 
different than adding optional fields to a protobuf response message.

bq. Bug fixes are the same. There have been several times that msgpack has 
gotten unicode incorrect. If we needed to change the type of a field that would 
be a one off thing. With protobuf and thrift there are set rules around how to 
do that in compatible ways.

It's not really that "msgpack got unicode incorrect", it's just that they left 
the choice of string encoding up to the programmers, which was a bad idea.  But 
if you just use common sense and make everything UTF-8 there are no problems.

bq. There seems to be official C binding: https://github.com/msgpack/msgpack-c. 
 Any reason to prefer CMP to msgpack-c?

CMP is two source code files, which we can easily embed into our code.  
msgpack-c is many more, and would require an external dependency or 3rd-party 
build process.

[~abec] and I are giving an HTrace talk today from 2:20pm-2:40pm at HBaseCon.  
Are you guys available to meet after the talk (i.e. at 2:40pm) to talk about 
this?

> htrace hrpc: use msgpack for serialization
> ------------------------------------------
>
>                 Key: HTRACE-164
>                 URL: https://issues.apache.org/jira/browse/HTRACE-164
>             Project: HTrace
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HTRACE-164.002.patch
>
>
> htrace HRPC should use msgpack for serialization.  Messages serialized using 
> msgpack use less space on the wire and use less CPU time to encode.  The CMP 
> library allows us to include msgpack support easily in the htrace C client.  
> There is also good Java and Golang support available.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to