/** * * * <pre> * A set of attributes on the link. You have have up to 32 attributes per * link. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code> */ public Builder mergeAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) { if (attributesBuilder_ == null) { if (attributes_ != null) { attributes_ = com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder(attributes_) .mergeFrom(value) .buildPartial(); } else { attributes_ = value; } onChanged(); } else { attributesBuilder_.mergeFrom(value); } return this; } /**
/** Use {@link #getAttributeMapMap()} instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue> getAttributeMap() { return getAttributeMapMap(); } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (!internalGetAttributeMap().getMap().isEmpty()) { hash = (37 * hash) + ATTRIBUTE_MAP_FIELD_NUMBER; hash = (53 * hash) + internalGetAttributeMap().hashCode(); } hash = (37 * hash) + DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER; hash = (53 * hash) + getDroppedAttributesCount(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
.setDescription( TruncatableString.newBuilder().setValue(ANNOTATION_TEXT).build()) .setAttributes(Span.Attributes.newBuilder().build()) .build()) .setTime( .setDescription( TruncatableString.newBuilder().setValue(ANNOTATION_TEXT).build()) .setAttributes(Span.Attributes.newBuilder().build()) .build()) .setTime( .setTraceId(TRACE_ID) .setSpanId(SPAN_ID) .setAttributes(Span.Attributes.newBuilder().build()) .build()) .build(); assertThat(span.getStartTime()).isEqualTo(startTime); assertThat(span.getEndTime()).isEqualTo(endTime); assertThat(span.getAttributes().getDroppedAttributesCount()) .isEqualTo(DROPPED_ATTRIBUTES_COUNT); assertThat(span.getAttributes().getAttributeMapMap()) .containsEntry(ATTRIBUTE_KEY_1, AttributeValue.newBuilder().setIntValue(10L).build()); assertThat(span.getAttributes().getAttributeMapMap()) .containsEntry(ATTRIBUTE_KEY_2, AttributeValue.newBuilder().setBoolValue(true).build());
result = result && getAttributes().equals(other.getAttributes());
Attributes.Builder attributes = Attributes.newBuilder();
handler.generateSpan( spanData, EMPTY_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()); Map<String, AttributeValue> attributes = span.getAttributes().getAttributeMapMap();
/** * * * <pre> * A set of attributes on the span. You can have up to 32 attributes per * span. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code> */ public Builder mergeAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) { if (attributesBuilder_ == null) { if (attributes_ != null) { attributes_ = com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder(attributes_) .mergeFrom(value) .buildPartial(); } else { attributes_ = value; } onChanged(); } else { attributesBuilder_.mergeFrom(value); } return this; } /**
/** * * * <pre> * A set of attributes on the link. You have have up to 32 attributes per * link. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code> */ public Builder mergeAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) { if (attributesBuilder_ == null) { if (attributes_ != null) { attributes_ = com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder(attributes_) .mergeFrom(value) .buildPartial(); } else { attributes_ = value; } onChanged(); } else { attributesBuilder_.mergeFrom(value); } return this; } /**
Map<String, AttributeValue> attributeMap = span.getAttributes().getAttributeMapMap(); assertThat(attributeMap.entrySet()).containsAllIn(fixedAttributes.entrySet());
/** * * * <pre> * A set of attributes on the annotation. You can have up to 4 attributes * per Annotation. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code> */ public Builder mergeAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) { if (attributesBuilder_ == null) { if (attributes_ != null) { attributes_ = com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder(attributes_) .mergeFrom(value) .buildPartial(); } else { attributes_ = value; } onChanged(); } else { attributesBuilder_.mergeFrom(value); } return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.Link)) { return super.equals(obj); } com.google.devtools.cloudtrace.v2.Span.Link other = (com.google.devtools.cloudtrace.v2.Span.Link) obj; boolean result = true; result = result && getTraceId().equals(other.getTraceId()); result = result && getSpanId().equals(other.getSpanId()); result = result && type_ == other.type_; result = result && (hasAttributes() == other.hasAttributes()); if (hasAttributes()) { result = result && getAttributes().equals(other.getAttributes()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@Test public void generateSpan_WithResourceLabels() { SpanData spanData = SpanData.create( spanContext, parentSpanId, /* hasRemoteParent= */ true, SPAN_NAME, null, startTimestamp, attributes, annotations, messageEvents, links, CHILD_SPAN_COUNT, status, endTimestamp); Span span = handler.generateSpan( spanData, AWS_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()); Map<String, AttributeValue> attributeMap = span.getAttributes().getAttributeMapMap(); assertThat(attributeMap.entrySet()).containsAllIn(AWS_RESOURCE_LABELS.entrySet()); }
/** * * * <pre> * A set of attributes on the annotation. You can have up to 4 attributes * per Annotation. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code> */ public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() { if (attributesBuilder_ != null) { return attributesBuilder_.getMessageOrBuilder(); } else { return attributes_ == null ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance() : attributes_; } } /**
/** * * * <pre> * A set of attributes on the annotation. You can have up to 4 attributes * per Annotation. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code> */ public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() { if (attributesBuilder_ == null) { return attributes_ == null ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance() : attributes_; } else { return attributesBuilder_.getMessage(); } } /**
/** * * * <pre> * A set of attributes on the span. You can have up to 32 attributes per * span. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code> */ public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() { if (attributesBuilder_ == null) { return attributes_ == null ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance() : attributes_; } else { return attributesBuilder_.getMessage(); } } /**
/** * * * <pre> * A set of attributes on the link. You have have up to 32 attributes per * link. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code> */ public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() { if (attributesBuilder_ != null) { return attributesBuilder_.getMessageOrBuilder(); } else { return attributes_ == null ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance() : attributes_; } } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)) { return super.equals(obj); } com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation other = (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) obj; boolean result = true; result = result && (hasDescription() == other.hasDescription()); if (hasDescription()) { result = result && getDescription().equals(other.getDescription()); } result = result && (hasAttributes() == other.hasAttributes()); if (hasAttributes()) { result = result && getAttributes().equals(other.getAttributes()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * A set of attributes on the span. You can have up to 32 attributes per * span. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code> */ public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() { if (attributesBuilder_ != null) { return attributesBuilder_.getMessageOrBuilder(); } else { return attributes_ == null ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance() : attributes_; } } /**
/** * * * <pre> * A set of attributes on the link. You have have up to 32 attributes per * link. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code> */ public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() { if (attributesBuilder_ == null) { return attributes_ == null ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance() : attributes_; } else { return attributesBuilder_.getMessage(); } } /**