Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Change context() to getContext()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Sigelman committed Jul 15, 2016
1 parent 2f92013 commit ff2d9ff
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion opentracing-api/src/main/java/io/opentracing/Span.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface Span extends AutoCloseable {
*
* @return the SpanContext that encapsulates Span state that should propagate across process boundaries.
*/
SpanContext context();
SpanContext getContext();

/**
* Sets the end timestamp and records the span.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface SpanContext {
/**
* Sets a baggage item in the SpanContext as a key/value pair.
*
* Baggage enables powerful distributed context propagation functionality where arbitrary application data can be carried along the full path of request execution throughout the system.
* Baggage enables powerful distributed getContext propagation functionality where arbitrary application data can be carried along the full path of request execution throughout the system.
*
* Note 1: Baggage is only propagated to the future (recursive) children of this SpanContext.
*
Expand Down
4 changes: 2 additions & 2 deletions opentracing-api/src/main/java/io/opentracing/Tracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface Tracer {
.start();
Span http = tracer.buildSpan("HandleHTTPRequest")
.asChildOf(parentSpan.context())
.asChildOf(parentSpan.getContext())
.withTag("user_agent", req.UserAgent)
.withTag("lucky_number", 42)
.start();
Expand All @@ -46,7 +46,7 @@ public interface Tracer {
* Tracer tracer = ...
* Span clientSpan = ...
* HttpHeaderWriter httpHeaderWriter = new AnHttpHeaderCarrier(httpRequest);
* tracer.inject(span.context(), httpHeaderWriter);
* tracer.inject(span.getContext(), httpHeaderWriter);
* }</pre>
*
* @param spanContext the SpanContext instance to inject into the carrier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public final Span start() {
stringTags.entrySet().stream().forEach((entry) -> { span.setTag(entry.getKey(), entry.getValue()); });
booleanTags.entrySet().stream().forEach((entry) -> { span.setTag(entry.getKey(), entry.getValue()); });
numberTags.entrySet().stream().forEach((entry) -> { span.setTag(entry.getKey(), entry.getValue()); });
baggage.entrySet().stream().forEach((entry) -> { span.context().setBaggageItem(entry.getKey(), entry.getValue()); });
baggage.entrySet().stream().forEach((entry) -> { span.getContext().setBaggageItem(entry.getKey(), entry.getValue()); });
return span;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public void testInject() {
SpanContext spanContext = new TestSpanContextImpl("whatever");

@Override
public SpanContext context() {
public SpanContext getContext() {
return spanContext;
}
};
Map<String,String> map = new HashMap<>();
TextMapWriter carrier = new TextMapImpl(map);
instance.inject(span.context(), carrier);
instance.inject(span.getContext(), carrier);

assertEquals(
"marker should have been injected into map",
Expand Down Expand Up @@ -116,7 +116,7 @@ protected AbstractSpan createSpan() {
SpanContext spanContext = new TestSpanContextImpl("op=" + operationName);

@Override
public SpanContext context() {
public SpanContext getContext() {
return spanContext;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class NoopSpan implements Span {
private NoopSpan() {}

@Override
public SpanContext context() { return CONTEXT_INSTANCE; }
public SpanContext getContext() { return CONTEXT_INSTANCE; }

@Override
public void finish() {}
Expand Down

0 comments on commit ff2d9ff

Please sign in to comment.