Skip to content

Commit

Permalink
Extracts v2 library
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Cole authored and adriancole committed Sep 12, 2017
1 parent e62c86f commit 5c8a176
Show file tree
Hide file tree
Showing 135 changed files with 1,559 additions and 1,194 deletions.
2 changes: 1 addition & 1 deletion benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>parent</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>benchmarks</artifactId>
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/src/main/java/zipkin/benchmarks/CodecBenchmarks.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
import org.openjdk.jmh.runner.options.OptionsBuilder;
import zipkin.Codec;
import zipkin.Endpoint;
import zipkin.internal.v2.Span;
import zipkin.internal.v2.codec.SpanBytesCodec;
import zipkin.internal.v2.codec.SpanBytesEncoder;
import zipkin2.Span;
import zipkin2.codec.SpanBytesDecoder;
import zipkin2.codec.SpanBytesEncoder;

/**
* This compares the speed of the bundled java codec with the approach used in the scala
Expand Down Expand Up @@ -157,18 +157,18 @@ public byte[] writeClientSpan_thrift_libthrift() throws TException {
}

static final byte[] zipkin2Json = read("/zipkin2-client.json");
static final Span zipkin2 = SpanBytesCodec.JSON_V2.decode(zipkin2Json);
static final Span zipkin2 = SpanBytesDecoder.JSON_V2.decodeOne(zipkin2Json);
static final List<Span> tenSpan2s = Collections.nCopies(10, zipkin2);
static final byte[] tenSpan2sJson = SpanBytesCodec.JSON_V2.encodeList(tenSpan2s);
static final byte[] tenSpan2sJson = SpanBytesEncoder.JSON_V2.encodeList(tenSpan2s);

@Benchmark
public Span readClientSpan_json_zipkin2() {
return SpanBytesCodec.JSON_V2.decode(zipkin2Json);
return SpanBytesDecoder.JSON_V2.decodeOne(zipkin2Json);
}

@Benchmark
public List<Span> readTenClientSpans_json_zipkin2() {
return SpanBytesCodec.JSON_V2.decodeList(tenSpan2sJson);
return SpanBytesDecoder.JSON_V2.decodeList(tenSpan2sJson);
}

@Benchmark
Expand Down Expand Up @@ -264,7 +264,7 @@ public byte[] writeRpcV6Span_thrift_libthrift() throws TException {
// Convenience main entry-point
public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder()
.include(".*" + CodecBenchmarks.class.getSimpleName() + ".*")
.include(".*" + CodecBenchmarks.class.getSimpleName() + ".*readTenClientSpans_json_zipkin2,*")
.build();

new Runner(opt).run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import zipkin.Constants;
import zipkin.Endpoint;
import zipkin.TraceKeys;
import zipkin.internal.v2.Span;
import zipkin2.Span;
import zipkin.internal.V2SpanConverter;
import zipkin.internal.Util;

Expand Down Expand Up @@ -95,8 +95,8 @@ public class Span2ConverterBenchmarks {
.name("get")
.kind(Span.Kind.SERVER)
.shared(true)
.localEndpoint(V2SpanConverter.fromEndpoint(backend))
.remoteEndpoint(V2SpanConverter.fromEndpoint(frontend))
.localEndpoint(backend.toV2())
.remoteEndpoint(frontend.toV2())
.timestamp(1472470996250000L)
.duration(100000L)
.putTag(TraceKeys.HTTP_PATH, "/backend")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import zipkin.Endpoint;
import zipkin.TraceKeys;
import zipkin.internal.Util;
import zipkin.internal.v2.Span;
import zipkin2.Span;

@Measurement(iterations = 5, time = 1)
@Warmup(iterations = 10, time = 1)
Expand Down Expand Up @@ -79,11 +79,11 @@ public zipkin.Span buildLocalSpan() {
.ipv4(192 << 24 | 168 << 16 | 99 << 8 | 101)
.port(9000)
.build();
static final zipkin.internal.v2.Endpoint frontend2 = zipkin.internal.v2.Endpoint.newBuilder()
static final zipkin2.Endpoint frontend2 = zipkin2.Endpoint.newBuilder()
.serviceName("frontend")
.ip("127.0.0.1")
.build();
static final zipkin.internal.v2.Endpoint backend2 = zipkin.internal.v2.Endpoint.newBuilder()
static final zipkin2.Endpoint backend2 = zipkin2.Endpoint.newBuilder()
.serviceName("backend")
.ip("192.168.99.101")
.port(9000)
Expand Down
3 changes: 2 additions & 1 deletion circleci/pom-no-crossmodule-dependencies.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:copy>
</xsl:template>

<xsl:template match="pom:dependency[pom:groupId = 'io.zipkin.java']" />
<xsl:template match="pom:dependency[pom:groupId = 'io.zipkin.zipkin2']" />
<xsl:template match="pom:dependency[pom:groupId = '${project.groupId}']" />
</xsl:stylesheet>
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

<groupId>io.zipkin.java</groupId>
<artifactId>parent</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>zipkin2</module>
<module>zipkin</module>
<module>zipkin-ui</module>
<module>zipkin-junit</module>
Expand Down Expand Up @@ -142,6 +143,12 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>zipkin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/collector-kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-collector-kafka</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/collector-kafka10/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-collector-kafka10</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/collector-scribe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-collector-scribe</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/metrics-prometheus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>zipkin-autoconfigure</artifactId>
<groupId>io.zipkin.java</groupId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>parent</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/storage-cassandra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-storage-cassandra</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/storage-cassandra3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-storage-cassandra3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/storage-elasticsearch-aws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-storage-elasticsearch-aws</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/storage-elasticsearch-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-storage-elasticsearch-http</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/storage-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-storage-mysql</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-autoconfigure/ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-autoconfigure-ui</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-collector</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector-kafka</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
import zipkin.collector.kafka.KafkaCollector.Builder;
import zipkin.internal.ApplyTimestampAndDuration;
import zipkin.internal.V2SpanConverter;
import zipkin.internal.v2.codec.SpanBytesEncoder;
import zipkin.storage.AsyncSpanConsumer;
import zipkin.storage.AsyncSpanStore;
import zipkin.storage.SpanStore;
import zipkin.storage.StorageComponent;
import zipkin2.codec.SpanBytesEncoder;

import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static zipkin.TestObjects.LOTS_OF_SPANS;
import static zipkin.TestObjects.TRACE;
Expand Down Expand Up @@ -146,10 +145,7 @@ public void messageWithMultipleSpans_json2() throws Exception {
ApplyTimestampAndDuration.apply(LOTS_OF_SPANS[1])
);

byte[] message = SpanBytesEncoder.JSON_V2.encodeList(asList(
V2SpanConverter.fromSpan(spans.get(0)).get(0),
V2SpanConverter.fromSpan(spans.get(1)).get(0)
));
byte[] message = SpanBytesEncoder.JSON_V2.encodeList(V2SpanConverter.fromSpans(spans));

producer.send(new KeyedMessage<>(builder.topic, message));

Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/kafka10/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-collector</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector-kafka10</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@
import zipkin.collector.kafka10.KafkaCollector.Builder;
import zipkin.internal.ApplyTimestampAndDuration;
import zipkin.internal.V2SpanConverter;
import zipkin.internal.v2.codec.SpanBytesEncoder;
import zipkin.storage.AsyncSpanConsumer;
import zipkin.storage.AsyncSpanStore;
import zipkin.storage.SpanStore;
import zipkin.storage.StorageComponent;
import zipkin2.codec.SpanBytesEncoder;

import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static zipkin.TestObjects.LOTS_OF_SPANS;
import static zipkin.TestObjects.TRACE;
Expand Down Expand Up @@ -200,10 +199,7 @@ public void messageWithMultipleSpans_json2() throws Exception {
ApplyTimestampAndDuration.apply(LOTS_OF_SPANS[1])
);

byte[] message = SpanBytesEncoder.JSON_V2.encodeList(asList(
V2SpanConverter.fromSpan(spans.get(0)).get(0),
V2SpanConverter.fromSpan(spans.get(1)).get(0)
));
byte[] message = SpanBytesEncoder.JSON_V2.encodeList(V2SpanConverter.fromSpans(spans));

produceSpans(message, builder.topic);

Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>parent</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-collector/scribe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-collector</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-collector-scribe</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion zipkin-guava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>parent</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
7 changes: 6 additions & 1 deletion zipkin-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.zipkin.java</groupId>
<artifactId>parent</artifactId>
<version>1.31.4-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>zipkin-junit</artifactId>
Expand All @@ -32,6 +32,11 @@
</properties>

<dependencies>
<dependency>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin</artifactId>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>zipkin</artifactId>
Expand Down
Loading

0 comments on commit 5c8a176

Please sign in to comment.