public BinaryAnnotation deepCopy() { return new BinaryAnnotation(this); }
public BinaryAnnotation deepCopy() { return new BinaryAnnotation(this); }
public BinaryAnnotation deepCopy() { return new BinaryAnnotation(this); }
public static BinaryAnnotation create(String key, byte[] value, AnnotationType type, @Nullable Endpoint endpoint) { return new BinaryAnnotation(key, value, type, endpoint); }
public static BinaryAnnotation create(String key, byte[] value, AnnotationType type, @Nullable Endpoint endpoint) { return new BinaryAnnotation(key, value, type, endpoint); }
/** * Interface method implementation. * @see com.github.kristofa.brave.SpanCollector#addDefaultAnnotation(java.lang.String, java.lang.String) */ public void addDefaultAnnotation(String key, String value) { try { final ByteBuffer bb = ByteBuffer.wrap(value.getBytes(UTF_8)); final BinaryAnnotation binaryAnnotation = new BinaryAnnotation(); binaryAnnotation.setKey(key); binaryAnnotation.setValue(bb); binaryAnnotation.setAnnotation_type(AnnotationType.STRING); this.defaultAnnotations.add(binaryAnnotation); } catch (final UnsupportedEncodingException e) { throw new IllegalStateException(e); } }
/** * {@inheritDoc} */ @Override public void addDefaultAnnotation(final String key, final String value) { Validate.notEmpty(key); Validate.notNull(value); try { final ByteBuffer bb = ByteBuffer.wrap(value.getBytes(UTF_8)); final BinaryAnnotation binaryAnnotation = new BinaryAnnotation(); binaryAnnotation.setKey(key); binaryAnnotation.setValue(bb); binaryAnnotation.setAnnotation_type(AnnotationType.STRING); defaultAnnotations.add(binaryAnnotation); } catch (final UnsupportedEncodingException e) { throw new IllegalStateException(e); } }
/** * 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; }
/** * Performs a deep copy on <i>other</i>. */ public Span(Span other) { __isset_bitfield = other.__isset_bitfield; this.trace_id = other.trace_id; if (other.isSetName()) { this.name = other.name; } this.id = other.id; this.parent_id = other.parent_id; if (other.isSetAnnotations()) { List<Annotation> __this__annotations = new ArrayList<Annotation>(); for (Annotation other_element : other.annotations) { __this__annotations.add(new Annotation(other_element)); } this.annotations = __this__annotations; } if (other.isSetBinary_annotations()) { List<BinaryAnnotation> __this__binary_annotations = new ArrayList<BinaryAnnotation>(); for (BinaryAnnotation other_element : other.binary_annotations) { __this__binary_annotations.add(new BinaryAnnotation(other_element)); } this.binary_annotations = __this__binary_annotations; } this.debug = other.debug; }
/** * Performs a deep copy on <i>other</i>. */ public Span(Span other) { __isset_bitfield = other.__isset_bitfield; this.trace_id = other.trace_id; if (other.isSetName()) { this.name = other.name; } this.id = other.id; this.parent_id = other.parent_id; if (other.isSetAnnotations()) { List<Annotation> __this__annotations = new ArrayList<Annotation>(); for (Annotation other_element : other.annotations) { __this__annotations.add(new Annotation(other_element)); } this.annotations = __this__annotations; } if (other.isSetBinary_annotations()) { List<BinaryAnnotation> __this__binary_annotations = new ArrayList<BinaryAnnotation>(); for (BinaryAnnotation other_element : other.binary_annotations) { __this__binary_annotations.add(new BinaryAnnotation(other_element)); } this.binary_annotations = __this__binary_annotations; } this.debug = other.debug; }
/** * 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; }
/** * Performs a deep copy on <i>other</i>. */ public Span(Span other) { __isset_bitfield = other.__isset_bitfield; this.trace_id = other.trace_id; if (other.isSetName()) { this.name = other.name; } this.id = other.id; this.parent_id = other.parent_id; if (other.isSetAnnotations()) { List<Annotation> __this__annotations = new ArrayList<Annotation>(); for (Annotation other_element : other.annotations) { __this__annotations.add(new Annotation(other_element)); } this.annotations = __this__annotations; } if (other.isSetBinary_annotations()) { List<BinaryAnnotation> __this__binary_annotations = new ArrayList<BinaryAnnotation>(); for (BinaryAnnotation other_element : other.binary_annotations) { __this__binary_annotations.add(new BinaryAnnotation(other_element)); } this.binary_annotations = __this__binary_annotations; } this.debug = other.debug; }
/** * 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); }
_elem5 = new BinaryAnnotation(); _elem5.read(iprot); struct.binary_annotations.add(_elem5);
_elem15 = new BinaryAnnotation(); _elem15.read(iprot); struct.binary_annotations.add(_elem15);
_elem15 = new BinaryAnnotation(); _elem15.read(iprot); struct.binary_annotations.add(_elem15);
_elem15 = new BinaryAnnotation(); _elem15.read(iprot); struct.binary_annotations.add(_elem15);
_elem5 = new BinaryAnnotation(); _elem5.read(iprot); struct.binary_annotations.add(_elem5);
_elem5 = new BinaryAnnotation(); _elem5.read(iprot); struct.binary_annotations.add(_elem5);