htrace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject incubator-htrace git commit: HTRACE-393 Changed binary annotations type from binary to string
Date Tue, 03 Jan 2017 20:59:53 GMT
Repository: incubator-htrace
Updated Branches:
  refs/heads/master 14fb8f108 -> bf03c0bdf


HTRACE-393 Changed binary annotations type from binary to string

Signed-off-by: Michael Stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/bf03c0bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/bf03c0bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/bf03c0bd

Branch: refs/heads/master
Commit: bf03c0bdf8b2ffc2d393be369b7152047992d299
Parents: 14fb8f1
Author: rrh <raam@findhotel.net>
Authored: Tue Jan 3 17:22:46 2017 +0100
Committer: Michael Stack <stack@apache.org>
Committed: Tue Jan 3 11:54:28 2017 -0800

----------------------------------------------------------------------
 .../org/apache/htrace/zipkin/HTraceToZipkinConverter.java   | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/bf03c0bd/htrace-zipkin/src/main/java/org/apache/htrace/zipkin/HTraceToZipkinConverter.java
----------------------------------------------------------------------
diff --git a/htrace-zipkin/src/main/java/org/apache/htrace/zipkin/HTraceToZipkinConverter.java
b/htrace-zipkin/src/main/java/org/apache/htrace/zipkin/HTraceToZipkinConverter.java
index 44baea0..5b23032 100644
--- a/htrace-zipkin/src/main/java/org/apache/htrace/zipkin/HTraceToZipkinConverter.java
+++ b/htrace-zipkin/src/main/java/org/apache/htrace/zipkin/HTraceToZipkinConverter.java
@@ -27,6 +27,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.htrace.core.TimelineAnnotation;
 
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -153,13 +154,9 @@ public class HTraceToZipkinConverter {
     List<BinaryAnnotation> l = new ArrayList<BinaryAnnotation>();
     for (Map.Entry<String, String> e : span.getKVAnnotations().entrySet()) {
       BinaryAnnotation binaryAnn = new BinaryAnnotation();
-      binaryAnn.setAnnotation_type(AnnotationType.BYTES);
+      binaryAnn.setAnnotation_type(AnnotationType.STRING);
       binaryAnn.setKey(e.getKey());
-      try {
-        binaryAnn.setValue(e.getValue().getBytes("UTF-8"));
-      } catch (UnsupportedEncodingException ex) {
-        LOG.error("Error encoding string as UTF-8", ex);
-      }
+      binaryAnn.setValue(e.getValue().getBytes(StandardCharsets.UTF_8));
       binaryAnn.setHost(ep);
       l.add(binaryAnn);
     }


Mime
View raw message