Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily prefers gRPC's guava #2463

Merged
merged 1 commit into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<dependency>
Expand Down
16 changes: 13 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@
<!-- Java 8 dep, which is ok as zipkin-mysql is Java 8 anyway -->
<HikariCP.version>3.3.1</HikariCP.version>
<log4j.version>2.11.2</log4j.version>
<!-- Be careful to set this as a provided dep, so that it doesn't interfere with dependencies
from other projects. For example, cassandra and spring boot set guava versions -->
<guava.version>19.0</guava.version>

<junit.version>4.12</junit.version>
<powermock.version>2.0.0</powermock.version>
Expand Down Expand Up @@ -238,6 +235,19 @@
<version>${project.version}</version>
</dependency>

<!-- Borrowing grpc 0.19 version of guava until we port zipkin-gcp to armeria -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-android</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 The OpenZipkin Authors
* Copyright 2015-2019 The OpenZipkin Authors
*
* 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
Expand Down Expand Up @@ -101,7 +101,7 @@ static List<InetSocketAddress> parseContactPoints(CassandraStorage cassandra) {
List<InetSocketAddress> result = new ArrayList<>();
for (String contactPoint : cassandra.contactPoints.split(",")) {
HostAndPort parsed = HostAndPort.fromString(contactPoint);
result.add(new InetSocketAddress(parsed.getHostText(), parsed.getPortOrDefault(9042)));
result.add(new InetSocketAddress(parsed.getHost(), parsed.getPortOrDefault(9042)));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected void waitUntilContainerStarted() {
}

HostAndPort hap = HostAndPort.fromParts(getContainerIpAddress(), getMappedPort(9042));
InetSocketAddress address = new InetSocketAddress(hap.getHostText(), hap.getPort());
InetSocketAddress address = new InetSocketAddress(hap.getHost(), hap.getPort());

try (Cluster cluster = getCluster(address);
Session session = cluster.newSession()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 The OpenZipkin Authors
* Copyright 2015-2019 The OpenZipkin Authors
*
* 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
Expand Down Expand Up @@ -126,7 +126,7 @@ static List<InetSocketAddress> parseContactPoints(CassandraStorage cassandra) {
List<InetSocketAddress> result = new ArrayList<>();
for (String contactPoint : cassandra.contactPoints().split(",")) {
HostAndPort parsed = HostAndPort.fromString(contactPoint);
result.add(new InetSocketAddress(parsed.getHostText(), parsed.getPortOrDefault(9042)));
result.add(new InetSocketAddress(parsed.getHost(), parsed.getPortOrDefault(9042)));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected void waitUntilContainerStarted() {
}

HostAndPort hap = HostAndPort.fromParts(getContainerIpAddress(), getMappedPort(9042));
InetSocketAddress address = new InetSocketAddress(hap.getHostText(), hap.getPort());
InetSocketAddress address = new InetSocketAddress(hap.getHost(), hap.getPort());

try (Cluster cluster = getCluster(address);
Session session = cluster.newSession()) {
Expand Down
1 change: 0 additions & 1 deletion zipkin-storage/elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 The OpenZipkin Authors
* Copyright 2015-2019 The OpenZipkin Authors
*
* 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
Expand All @@ -14,10 +14,11 @@
package zipkin2.elasticsearch.internal.client;

import com.google.common.util.concurrent.SimpleTimeLimiter;
import com.google.common.util.concurrent.UncheckedTimeoutException;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.mockwebserver.MockResponse;
Expand Down Expand Up @@ -61,11 +62,14 @@ public void propagatesOnDispatcherThreadWhenFatal() throws Exception {
}
});

SimpleTimeLimiter timeLimiter = new SimpleTimeLimiter();
ExecutorService cached = Executors.newCachedThreadPool();
SimpleTimeLimiter timeLimiter = SimpleTimeLimiter.create(cached);
try {
timeLimiter.callWithTimeout(q::take, 100, TimeUnit.MILLISECONDS, true);
failBecauseExceptionWasNotThrown(UncheckedTimeoutException.class);
} catch (UncheckedTimeoutException expected) {
timeLimiter.callWithTimeout(q::take, 100, TimeUnit.MILLISECONDS);
failBecauseExceptionWasNotThrown(TimeoutException.class);
} catch (TimeoutException expected) {
} finally {
cached.shutdownNow();
}
}

Expand Down