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

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

The patch changes the key-value annotations to be a map<string, string>.  It 
keeps the old addKVAnnotation method that takes a byte array, to make the 
transition a bit easier.  For {{LocalFileSpanReceiver}}, this patch explicitly 
specifies the encoding of the file we're writing as UTF-8.  Unfortunately there 
is no way to do this with {{FileWriter}}, so I used a {{BufferedWriter}} 
wrapping an {{OutputStreamWriter}}.  We now write directly to the {{Writer}} 
rather than calling the {{Span#toJson}} method which returns a {{String}}.  
This should be slightly more efficient.

> Consider changing timeline annotations to be a map<string, string>
> ------------------------------------------------------------------
>
>                 Key: HTRACE-32
>                 URL: https://issues.apache.org/jira/browse/HTRACE-32
>             Project: HTrace
>          Issue Type: Bug
>            Reporter: Colin Patrick McCabe
>         Attachments: HTRACE-32.001.patch
>
>
> We should consider changing the timeline annotations in Span.java to be a 
> map<string, string> rather than a map<byte[], byte[]>.  It's very 
> inconvenient to deal with byte arrays here, and every use-case we have 
> currently puts string data into these fields.  One example is that you cannot 
> look up fields in the map, since the map<byte[], byte[]> compares by byte 
> array object equality (useless unless you have the original key array object 
> you inserted).  It's also questionable if we could put non-string data in 
> this map at all, since we are serializing them to JSON strings, which can't 
> handle arbitrary byte strings.



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

Reply via email to