Mark interfaces in trace/data immutable (#2729)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This commit is contained in:
parent
d6fea3a70a
commit
eb7e212587
|
|
@ -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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue