Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
36e5dac
[WIP] delegate all tracing calls to `tracing-java`
qinfchen Sep 6, 2018
f321e2c
cleanup
qinfchen Sep 6, 2018
c78a24b
Use published versions of libraries
iamdanfox Sep 6, 2018
edfa0d6
Everything compiles
iamdanfox Sep 6, 2018
6a8471a
Convert#span actually works now
iamdanfox Sep 6, 2018
68d893a
Implement Convert#toRemotingTrace
iamdanfox Sep 6, 2018
420c0e8
All converters propagate nulls
iamdanfox Sep 6, 2018
6ec78ae
Tracer#subscribe returns a remoting span observer
iamdanfox Sep 6, 2018
d4dc7d6
Delete redundant fully-qualified names in TracersTest
iamdanfox Sep 6, 2018
332bbe1
Move longToPaddedHex function out of Tracers
iamdanfox Sep 6, 2018
9e6effd
Delete an asConjure method
iamdanfox Sep 6, 2018
1beda24
@Ignore one TracerTest
iamdanfox Sep 6, 2018
6a02d6f
Thanks checkstyle
iamdanfox Sep 6, 2018
f3724a3
Reduce visibility of Convert class
iamdanfox Sep 6, 2018
9c45298
Fix one Convert method
iamdanfox Sep 6, 2018
13fb17c
Remove mavenLocal()
iamdanfox Sep 6, 2018
0a5b297
Move Utilities to test source set
iamdanfox Sep 6, 2018
8a06a46
Better javadoc and warnings
iamdanfox Sep 6, 2018
bb252e2
Restore CloseableTracerTest
iamdanfox Sep 6, 2018
badb51c
Delete some unused fields and point to their new locations
iamdanfox Sep 6, 2018
b20a71e
rearrange method orders and remove broken javadoc links
qinfchen Sep 6, 2018
1bd0d56
remove Tracers.TRACE_ID_KEY and use java-tracing TRACE_ID_KEY
qinfchen Sep 6, 2018
0ac9f54
thanks checkstyle
qinfchen Sep 6, 2018
e9c0d1e
Revert "remove Tracers.TRACE_ID_KEY and use java-tracing TRACE_ID_KEY"
iamdanfox Sep 7, 2018
adf0f74
Don't make Trace public
iamdanfox Sep 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reduce visibility of Convert class
  • Loading branch information
iamdanfox committed Sep 6, 2018
commit f3724a3d86ad423825d06e27763d40e06cd538db
19 changes: 4 additions & 15 deletions tracing/src/main/java/com/palantir/remoting3/tracing/Convert.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
package com.palantir.remoting3.tracing;

import com.palantir.remoting.api.tracing.OpenSpan;
import com.palantir.tracing.ExposedTrace;
import com.palantir.tracing.TraceSampler;
import com.palantir.tracing.api.Span;
import com.palantir.tracing.api.SpanObserver;
import com.palantir.tracing.api.SpanType;

/** Utility functions to convert old remoting-api classes to the new tracing-java ones and vice-versa. */
public final class Convert {
final class Convert {

private Convert() {}

Expand Down Expand Up @@ -105,7 +104,7 @@ static com.palantir.remoting.api.tracing.SpanType toRemotingSpanType(SpanType ty
throw new UnsupportedOperationException("Unable to convert to Remoting SpanType");
}

public static com.palantir.remoting.api.tracing.SpanObserver toRemotingSpanObserver(SpanObserver unsubscribe) {
static com.palantir.remoting.api.tracing.SpanObserver toRemotingSpanObserver(SpanObserver unsubscribe) {
if (unsubscribe == null) {
return null;
}
Expand All @@ -118,17 +117,7 @@ public void consume(com.palantir.remoting.api.tracing.Span span) {
};
}

public static Trace toRemotingTrace(com.palantir.tracing.Trace newTrace) {
if (newTrace == null) {
return null;
}

// Warning - this is NOT a lossless copy - the newTrace actually contains a stack of OpenSpans,
// which we can't access.
return new Trace(ExposedTrace.isObservable(newTrace), ExposedTrace.getTraceId(newTrace));
}

public static Span span(com.palantir.remoting.api.tracing.Span old) {
static Span span(com.palantir.remoting.api.tracing.Span old) {
if (old == null) {
return null;
}
Expand All @@ -145,7 +134,7 @@ public static Span span(com.palantir.remoting.api.tracing.Span old) {
.build();
}

public static TraceSampler traceSampler(com.palantir.remoting3.tracing.TraceSampler sampler) {
static TraceSampler traceSampler(com.palantir.remoting3.tracing.TraceSampler sampler) {
if (sampler == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.palantir.remoting3.tracing;

import com.palantir.tracing.ExposedTrace;

public final class TestConvert {

private TestConvert() {}

/** Warning - this is NOT a lossless copy, it loses the stack of OpenSpans in the original trace */
public static Trace toRemotingTraceIncompleteCopy(com.palantir.tracing.Trace newTrace) {
if (newTrace == null) {
return null;
}

return new Trace(ExposedTrace.isObservable(newTrace), ExposedTrace.getTraceId(newTrace));
}
}
5 changes: 2 additions & 3 deletions tracing/src/test/java/com/palantir/tracing/ExposedTracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

package com.palantir.tracing;

import com.palantir.remoting3.tracing.Convert;
import com.palantir.remoting3.tracing.TestConvert;

public final class ExposedTracer {

private ExposedTracer() {}

public static com.palantir.remoting3.tracing.Trace copyTrace() {
return Convert.toRemotingTrace(Tracer.copyTrace());
return TestConvert.toRemotingTraceIncompleteCopy(Tracer.copyTrace());
}

public static void setTrace(boolean isObservable, String traceId) {
Expand Down