Skip to content

Commit 9d98d56

Browse files
authored
Removes all deprecated things (Brave v5) (openzipkin#708)
1 parent 95b53b7 commit 9d98d56

File tree

79 files changed

+122
-2151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+122
-2151
lines changed

brave/pom.xml

-11
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@
2222
<groupId>io.zipkin.zipkin2</groupId>
2323
<artifactId>zipkin</artifactId>
2424
</dependency>
25-
<dependency>
26-
<groupId>io.zipkin.java</groupId>
27-
<artifactId>zipkin</artifactId>
28-
<optional>true</optional>
29-
</dependency>
30-
<dependency>
31-
<groupId>io.zipkin.reporter</groupId>
32-
<artifactId>zipkin-reporter</artifactId>
33-
<version>1.1.2</version>
34-
<optional>true</optional>
35-
</dependency>
3625
<dependency>
3726
<groupId>io.zipkin.reporter2</groupId>
3827
<artifactId>zipkin-reporter</artifactId>

brave/src/it/nozipkin1/README.md

-2
This file was deleted.

brave/src/it/nozipkin1/pom.xml

-62
This file was deleted.

brave/src/it/nozipkin1/src/test/java/brave/nozipkin1/DoesntRequireV1ClassesTest.java

-19
This file was deleted.

brave/src/main/java/brave/Clock.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package brave;
22

33
/**
4-
* Epoch microseconds used for {@link zipkin.Span#timestamp} and {@link
5-
* zipkin.Annotation#timestamp}.
4+
* Epoch microseconds used for {@link zipkin2.Span#timestamp} and {@link
5+
* zipkin2.Annotation#timestamp}.
66
*
77
* <p>This should use the most precise value possible. For example, {@code gettimeofday} or
88
* multiplying {@link System#currentTimeMillis} by 1000.

brave/src/main/java/brave/CurrentSpanCustomizer.java

-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,4 @@ public static CurrentSpanCustomizer create(Tracing tracing) {
3232
@Override public SpanCustomizer annotate(String value) {
3333
return tracer.currentSpanCustomizer().annotate(value);
3434
}
35-
36-
/** @deprecated use {@link #annotate(String)} as this can result in clock skew */
37-
@Deprecated @Override public SpanCustomizer annotate(long timestamp, String value) {
38-
return tracer.currentSpanCustomizer().annotate(timestamp, value);
39-
}
4035
}

brave/src/main/java/brave/NoopSpanCustomizer.java

-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,4 @@ public enum NoopSpanCustomizer implements SpanCustomizer {
1919
@Override public SpanCustomizer annotate(String value) {
2020
return this;
2121
}
22-
23-
/** @deprecated use {@link #annotate(String)} as this can result in clock skew */
24-
@Deprecated @Override public SpanCustomizer annotate(long timestamp, String value) {
25-
return this;
26-
}
2722
}

brave/src/main/java/brave/RealSpanCustomizer.java

-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ static RealSpanCustomizer create(TraceContext context, Recorder recorder) {
2525
return this;
2626
}
2727

28-
/** @deprecated use {@link #annotate(String)} as this can result in clock skew */
29-
@Override @Deprecated public SpanCustomizer annotate(long timestamp, String value) {
30-
recorder().annotate(context(), timestamp, value);
31-
return this;
32-
}
33-
3428
@Override public SpanCustomizer tag(String key, String value) {
3529
recorder().tag(context(), key, value);
3630
return this;

brave/src/main/java/brave/Span.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// Design note: this does not require a builder as the span is mutable anyway. Having a single
2929
// mutation interface is less code to maintain. Those looking to prepare a span before starting it
3030
// can simply call start when they are ready.
31-
// BRAVE5: do not inherit SpanCustomizer, rather just return it. This will prevent accidentally
31+
// BRAVE6: do not inherit SpanCustomizer, rather just return it. This will prevent accidentally
3232
// leaking lifecycle methods
3333
public abstract class Span implements SpanCustomizer {
3434
public enum Kind {
@@ -102,7 +102,7 @@ public enum Kind {
102102
* <p>Take extreme care with this feature as it is easy to have incorrect timestamps. If you must
103103
* use this, generate the timestamp using {@link Tracing#clock(TraceContext)}.
104104
*/
105-
@Override public abstract Span annotate(long timestamp, String value);
105+
public abstract Span annotate(long timestamp, String value);
106106

107107
/** {@inheritDoc} */
108108
@Override public abstract Span tag(String key, String value);
@@ -112,15 +112,6 @@ public enum Kind {
112112
// multi-catch. In practice, you should always at least catch RuntimeException and Error.
113113
public abstract Span error(Throwable throwable);
114114

115-
/**
116-
* @deprecated use {@link #remoteEndpoint(Endpoint)}, possibly with {@link zipkin.Endpoint#toV2()}
117-
*/
118-
@Deprecated
119-
public final Span remoteEndpoint(zipkin.Endpoint endpoint) {
120-
if (isNoop()) return this;
121-
return remoteEndpoint(endpoint.toV2());
122-
}
123-
124115
/**
125116
* For a client span, this would be the server's address.
126117
*
@@ -137,7 +128,7 @@ public final Span remoteEndpoint(zipkin.Endpoint endpoint) {
137128
/**
138129
* Like {@link #finish()}, except with a given timestamp in microseconds.
139130
*
140-
* <p>{@link zipkin.Span#duration Zipkin's span duration} is derived by subtracting the start
131+
* <p>{@link zipkin2.Span#duration Zipkin's span duration} is derived by subtracting the start
141132
* timestamp from this, and set when appropriate.
142133
*
143134
* <p>Take extreme care with this feature as it is easy to have incorrect timestamps. If you must

brave/src/main/java/brave/SpanCustomizer.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
*/
2020
// Note: this is exposed to users. We cannot add methods to this until Java 8 is required or we do a
2121
// major version bump
22-
// BRAVE5: add isNoop to avoid instanceof checks
23-
// BRAVE5: add error to support error handling
22+
// BRAVE6: add isNoop to avoid instanceof checks
23+
// BRAVE6: add error to support error handling
2424
public interface SpanCustomizer {
2525
/**
2626
* Sets the string name for the logical operation this span represents.
@@ -43,9 +43,4 @@ public interface SpanCustomizer {
4343
* @param value A short tag indicating the event, like "finagle.retry"
4444
*/
4545
SpanCustomizer annotate(String value);
46-
47-
/** @deprecated use {@link #annotate(String)} as this can result in clock skew */
48-
// BRAVE5: remove this: backdating ops should only be available on Span, as it isn't reasonable
49-
// for those only having a reference to SpanCustomizer to have a correct clock for the trace.
50-
@Deprecated SpanCustomizer annotate(long timestamp, String value);
5146
}

brave/src/main/java/brave/Tracer.java

+1-93
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import java.util.ArrayList;
1717
import java.util.List;
1818
import java.util.concurrent.atomic.AtomicBoolean;
19-
import zipkin2.Endpoint;
2019
import zipkin2.reporter.Reporter;
2120

2221
/**
@@ -60,87 +59,6 @@
6059
* @see Propagation
6160
*/
6261
public class Tracer {
63-
/** @deprecated Please use {@link Tracing#newBuilder()} */
64-
@Deprecated public static Builder newBuilder() {
65-
return new Builder();
66-
}
67-
68-
/** @deprecated Please use {@link Tracing.Builder} */
69-
@Deprecated public static final class Builder {
70-
final Tracing.Builder delegate = new Tracing.Builder();
71-
72-
/** @see Tracing.Builder#localServiceName(String) */
73-
public Builder localServiceName(String localServiceName) {
74-
delegate.localServiceName(localServiceName);
75-
return this;
76-
}
77-
78-
/** @deprecated use {@link #endpoint(Endpoint)}, possibly with {@link zipkin.Endpoint#toV2()} */
79-
@Deprecated
80-
public Builder localEndpoint(zipkin.Endpoint localEndpoint) {
81-
return endpoint(localEndpoint.toV2());
82-
}
83-
84-
/** @deprecated use {@link #endpoint(Endpoint)} */
85-
@Deprecated
86-
public Builder localEndpoint(Endpoint localEndpoint) {
87-
delegate.endpoint(localEndpoint);
88-
return this;
89-
}
90-
91-
/** @see Tracing.Builder#endpoint(Endpoint) */
92-
public Builder endpoint(Endpoint endpoint) {
93-
delegate.endpoint(endpoint);
94-
return this;
95-
}
96-
97-
/** @deprecated use {@link #spanReporter(Reporter)} */
98-
@Deprecated
99-
public Builder reporter(zipkin.reporter.Reporter<zipkin.Span> reporter) {
100-
delegate.reporter(reporter);
101-
return this;
102-
}
103-
104-
/** @see Tracing.Builder#spanReporter(Reporter) */
105-
public Builder spanReporter(Reporter<zipkin2.Span> reporter) {
106-
delegate.spanReporter(reporter);
107-
return this;
108-
}
109-
110-
/** @see Tracing.Builder#clock(Clock) */
111-
public Builder clock(Clock clock) {
112-
delegate.clock(clock);
113-
return this;
114-
}
115-
116-
/** @see Tracing.Builder#sampler(Sampler) */
117-
public Builder sampler(Sampler sampler) {
118-
delegate.sampler(sampler);
119-
return this;
120-
}
121-
122-
/** @see Tracing.Builder#currentTraceContext(CurrentTraceContext) */
123-
public Builder currentTraceContext(CurrentTraceContext currentTraceContext) {
124-
delegate.currentTraceContext(currentTraceContext);
125-
return this;
126-
}
127-
128-
/** @see Tracing.Builder#traceId128Bit(boolean) */
129-
public Builder traceId128Bit(boolean traceId128Bit) {
130-
delegate.traceId128Bit(traceId128Bit);
131-
return this;
132-
}
133-
134-
/** @see Tracing.Builder#supportsJoin(boolean) */
135-
public Builder supportsJoin(boolean supportsJoin) {
136-
delegate.supportsJoin(supportsJoin);
137-
return this;
138-
}
139-
140-
public Tracer build() {
141-
return delegate.build().tracer();
142-
}
143-
}
14462

14563
final Clock clock;
14664
final Propagation.Factory propagationFactory;
@@ -204,11 +122,6 @@ public Tracer withSampler(Sampler sampler) {
204122
);
205123
}
206124

207-
/** @deprecated use {@link Tracing#clock(TraceContext)} */
208-
@Deprecated public Clock clock() {
209-
return clock;
210-
}
211-
212125
/**
213126
* Explicitly creates a new trace. The result will be a root span (no parent span ID).
214127
*
@@ -329,11 +242,6 @@ public Span nextSpan(TraceContextOrSamplingFlags extracted) {
329242
throw new AssertionError("should not reach here");
330243
}
331244

332-
/** @deprecated Prefer {@link #withSampler(Sampler)} */
333-
@Deprecated public Span newTrace(SamplingFlags samplingFlags) {
334-
return toSpan(newContextBuilder(null, samplingFlags).build());
335-
}
336-
337245
/** Converts the context as-is to a Span object */
338246
public Span toSpan(TraceContext context) {
339247
if (context == null) throw new NullPointerException("context == null");
@@ -397,7 +305,7 @@ public SpanInScope withSpanInScope(@Nullable Span span) {
397305
*
398306
* <p>Unlike {@link CurrentSpanCustomizer}, this represents a single span. Accordingly, this
399307
* reference should not be saved as a field. That said, it is more efficient to save this result
400-
* as a method-local variable vs repeated calls to {@link #currentSpanCustomizer()}.
308+
* as a method-local variable vs repeated calls.
401309
*/
402310
public SpanCustomizer currentSpanCustomizer() {
403311
TraceContext currentContext = currentTraceContext.get();

0 commit comments

Comments
 (0)