/** * 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.cloudera.htrace.Span span, Endpoint ep) { List<BinaryAnnotation> l = new ArrayList<BinaryAnnotation>(); for (Map.Entry<byte[], byte[]> e : span.getKVAnnotations().entrySet()) { BinaryAnnotation binaryAnn = new BinaryAnnotation(); binaryAnn.setAnnotation_type(AnnotationType.BYTES); binaryAnn.setKey(new String(e.getKey())); binaryAnn.setValue(e.getValue()); 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; }
/** * Submits a binary annotation with custom type. * * @param span Span. * @param endPoint Endpoint, optional, can be <code>null</code>. * @param key Key, should not be empty. * @param value Should not be null. * @param annotationType Indicates the type of the value. */ private void submitBinaryAnnotation(final Span span, final Endpoint endPoint, final String key, final ByteBuffer value, final AnnotationType annotationType) { Validate.notBlank(key); Validate.notNull(value); final BinaryAnnotation binaryAnnotation = new BinaryAnnotation(); binaryAnnotation.setKey(key); binaryAnnotation.setValue(value); binaryAnnotation.setAnnotation_type(annotationType); binaryAnnotation.setHost(endPoint); addBinaryAnnotation(span, binaryAnnotation); }
unsetHost(); } else { setHost((Endpoint)value);
unsetHost(); } else { setHost((Endpoint)value);
unsetHost(); } else { setHost((Endpoint)value);