@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getLabels() { return getLabelsMap(); } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.devtools.cloudtrace.v1.TraceSpan)) { return super.equals(obj); } com.google.devtools.cloudtrace.v1.TraceSpan other = (com.google.devtools.cloudtrace.v1.TraceSpan) obj; boolean result = true; result = result && (getSpanId() == other.getSpanId()); result = result && kind_ == other.kind_; result = result && getName().equals(other.getName()); result = result && (hasStartTime() == other.hasStartTime()); if (hasStartTime()) { result = result && getStartTime().equals(other.getStartTime()); } result = result && (hasEndTime() == other.hasEndTime()); if (hasEndTime()) { result = result && getEndTime().equals(other.getEndTime()); } result = result && (getParentSpanId() == other.getParentSpanId()); result = result && internalGetLabels().equals(other.internalGetLabels()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * Name of the span. Must be less than 128 bytes. The span name is sanitized * and displayed in the Stackdriver Trace tool in the * {% dynamic print site_values.console_name %}. * The name may be a method name or some other per-call site name. * For the same executable and the same call point, a best practice is * to use a consistent name, which makes it easier to correlate * cross-trace spans. * </pre> * * <code>string name = 3;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.devtools.cloudtrace.v1.TraceSpan other) { if (other == com.google.devtools.cloudtrace.v1.TraceSpan.getDefaultInstance()) return this; if (other.getSpanId() != 0L) { setSpanId(other.getSpanId()); } if (other.kind_ != 0) { setKindValue(other.getKindValue()); } if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasStartTime()) { mergeStartTime(other.getStartTime()); } if (other.hasEndTime()) { mergeEndTime(other.getEndTime()); } if (other.getParentSpanId() != 0L) { setParentSpanId(other.getParentSpanId()); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Adds a trace span message to this span buffer. * * @param span the trace span message to add to this buffer. */ public void put(TraceSpan span) { long spanId = span.getSpanId(); TraceSpan.Builder builder = spanMap.get(spanId); if (builder == null) { spanMap.put(spanId, span.toBuilder()); } else { spanMap.put(spanId, builder.mergeFrom(span)); } }
private int spanSize(TraceSpan span) { int size = 0; size += 8; // For span_id. size += 4; // For kind. size += span.getName().length(); size += 16; // For start_time. size += 16; // For end_time. size += 8; // For parent_span_id. size += labelsSize(span); return size; }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@java.lang.Override public com.google.devtools.cloudtrace.v1.TraceSpan buildPartial() { com.google.devtools.cloudtrace.v1.TraceSpan result = new com.google.devtools.cloudtrace.v1.TraceSpan(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.spanId_ = spanId_; result.kind_ = kind_; result.name_ = name_; if (startTimeBuilder_ == null) { result.startTime_ = startTime_; } else { result.startTime_ = startTimeBuilder_.build(); } if (endTimeBuilder_ == null) { result.endTime_ = endTime_; } else { result.endTime_ = endTimeBuilder_.build(); } result.parentSpanId_ = parentSpanId_; result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * Adds a trace span message to this span buffer. * * @param span the trace span message to add to this buffer. */ public void put(TraceSpan span) { long spanId = span.getSpanId(); TraceSpan.Builder builder = spanMap.get(spanId); if (builder == null) { spanMap.put(spanId, span.toBuilder()); } else { spanMap.put(spanId, builder.mergeFrom(span)); } }
private int spanSize(TraceSpan span) { int size = 0; size += 8; // For span_id. size += 4; // For kind. size += span.getName().length(); size += 16; // For start_time. size += 16; // For end_time. size += 8; // For parent_span_id. size += labelsSize(span); return size; }
public static Builder newBuilder(com.google.devtools.cloudtrace.v1.TraceSpan prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
/** * Converts a Zipkin Span into a Stackdriver Trace Span. * * @param zipkinSpan The Zipkin Span. * @return A Stackdriver Trace Span. */ public TraceSpan translate(Span zipkinSpan) { TraceSpan.Builder builder = TraceSpan.newBuilder(); translate(builder, zipkinSpan); return builder.build(); }
hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSpanId()); hash = (37 * hash) + KIND_FIELD_NUMBER; hash = (53 * hash) + kind_; hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasStartTime()) { hash = (37 * hash) + START_TIME_FIELD_NUMBER; hash = (53 * hash) + getStartTime().hashCode(); if (hasEndTime()) { hash = (37 * hash) + END_TIME_FIELD_NUMBER; hash = (53 * hash) + getEndTime().hashCode(); hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getParentSpanId()); if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode();
/** * Adds a trace span message to this span buffer. * * @param span the trace span message to add to this buffer. */ public void put(TraceSpan span) { long spanId = span.getSpanId(); TraceSpan.Builder builder = spanMap.get(spanId); if (builder == null) { spanMap.put(spanId, span.toBuilder()); } else { spanMap.put(spanId, builder.mergeFrom(span)); } }
private int labelsSize(TraceSpan span) { int size = 0; for (Map.Entry<String, String> label : span.getLabelsMap().entrySet()) { size += label.getKey().length() + label.getValue().length(); } return size; } }
private int spanSize(TraceSpan span) { int size = 0; size += 8; // For span_id. size += 4; // For kind. size += span.getName().length(); size += 16; // For start_time. size += 16; // For end_time. size += 8; // For parent_span_id. size += labelsSize(span); return size; }
private void appendSpan(Trace.Builder builder, Span zipkinSpan) { TraceSpan span = translator.translate(TraceSpan.newBuilder(), zipkinSpan).build(); builder.addSpans(span); }
/** * Adds a trace span message to this span buffer. * * @param span the trace span message to add to this buffer. */ public void put(TraceSpan span) { long spanId = span.getSpanId(); TraceSpan.Builder builder = spanMap.get(spanId); if (builder == null) { spanMap.put(spanId, span.toBuilder()); } else { spanMap.put(spanId, builder.mergeFrom(span)); } }
private int labelsSize(TraceSpan span) { int size = 0; for (Map.Entry<String, String> label : span.getLabelsMap().entrySet()) { size += label.getKey().length() + label.getValue().length(); } return size; } }