/** * Creates a list of Annotations that are present in HTrace Span object. * * @return list of Annotations that could be added to Zipkin Span. */ private List<BinaryAnnotation> createZipkinBinaryAnnotations(org.apache.htrace.core.Span span, Endpoint ep) { List<BinaryAnnotation> l = new ArrayList<BinaryAnnotation>(); for (Map.Entry<String, String> e : span.getKVAnnotations().entrySet()) { BinaryAnnotation binaryAnn = new BinaryAnnotation(); binaryAnn.setAnnotation_type(AnnotationType.STRING); binaryAnn.setKey(e.getKey()); binaryAnn.setValue(e.getValue().getBytes(StandardCharsets.UTF_8)); binaryAnn.setHost(ep); l.add(binaryAnn); } return l; }
/** * Creates a list of Annotations that are present in HTrace Span object. * * @return list of Annotations that could be added to Zipkin Span. */ private List<BinaryAnnotation> createZipkinBinaryAnnotations(org.apache.htrace.core.Span span, Endpoint ep) { 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.setKey(e.getKey()); try { binaryAnn.setValue(e.getValue().getBytes("UTF-8")); } catch (UnsupportedEncodingException ex) { LOG.error("Error encoding string as UTF-8", ex); } binaryAnn.setHost(ep); l.add(binaryAnn); } return l; }
Map<String, String> traceInfoMap = span.getKVAnnotations(); if (!traceInfoMap.isEmpty()) { jgen.writeObjectFieldStart("n");
Map<String, String> traceInfoMap = span.getKVAnnotations(); if (!traceInfoMap.isEmpty()) { jgen.writeObjectFieldStart("n");
Map<String, String> traceInfoMap = span.getKVAnnotations(); if (!traceInfoMap.isEmpty()) { jgen.writeObjectFieldStart("n");
assertEquals(expected.getTracerId(), got.getTracerId()); assertTrue(Arrays.equals(expected.getParents(), got.getParents())); Map<String, String> expectedT = expected.getKVAnnotations(); Map<String, String> gotT = got.getKVAnnotations(); if (expectedT == null) { assertEquals(null, gotT);