Mark interfaces in trace/data immutable (#2729)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This commit is contained in:
Bogdan Drutu 2021-02-05 20:30:17 -08:00 committed by GitHub
parent d6fea3a70a
commit eb7e212587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 3 deletions

View File

@ -7,7 +7,10 @@ package io.opentelemetry.sdk.trace.data;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.sdk.trace.SpanLimits;
import javax.annotation.concurrent.Immutable;
/** Data representation of a event. */
@Immutable
public interface EventData {
/**

View File

@ -10,8 +10,8 @@ import io.opentelemetry.api.common.Attributes;
import javax.annotation.concurrent.Immutable;
/** An immutable implementation of the {@link EventData}. */
@Immutable
@AutoValue
@Immutable
abstract class ImmutableEventData implements EventData {
/**

View File

@ -11,8 +11,8 @@ import io.opentelemetry.api.trace.SpanContext;
import javax.annotation.concurrent.Immutable;
/** An immutable implementation of {@link LinkData}. */
@Immutable
@AutoValue
@Immutable
abstract class ImmutableLinkData implements LinkData {
private static final Attributes DEFAULT_ATTRIBUTE_COLLECTION = Attributes.empty();
private static final int DEFAULT_ATTRIBUTE_COUNT = 0;

View File

@ -8,13 +8,15 @@ package io.opentelemetry.sdk.trace.data;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.SpanContext;
import io.opentelemetry.sdk.trace.SpanLimits;
import javax.annotation.concurrent.Immutable;
/**
* Data representation of a Link.
* Data representation of a link.
*
* <p>Used (for example) in batching operations, where a single batch handler processes multiple
* requests from different traces. Link can be also used to reference spans from the same trace.
*/
@Immutable
public interface LinkData {
/**

View File

@ -8,11 +8,13 @@ package io.opentelemetry.sdk.trace.data;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.StatusCode;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
/**
* Defines the status of a {@link Span} by providing a standard {@link StatusCode} in conjunction
* with an optional descriptive message.
*/
@Immutable
public interface StatusData {
/**