Skip to content

Commit a15d6a9

Browse files
doctorXWritesashishagg
authored andcommitted
Haystack commons refactor (#101)
* use haystack idl instead of entire commons library * creating a separate remote clients module * bumping up the haystack client java release version * updating the parent version for pom
1 parent 58326ce commit a15d6a9

File tree

20 files changed

+230
-13
lines changed

20 files changed

+230
-13
lines changed

core/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.expedia.www</groupId>
77
<artifactId>haystack-client-java-parent</artifactId>
8-
<version>0.2.6-SNAPSHOT</version>
8+
<version>0.2.7-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>haystack-client-core</artifactId>
@@ -20,6 +20,12 @@
2020
<version>${project.version}</version>
2121
</dependency>
2222

23+
<dependency>
24+
<groupId>com.expedia.www</groupId>
25+
<artifactId>haystack-remote-clients</artifactId>
26+
<version>${project.version}</version>
27+
</dependency>
28+
2329
<dependency>
2430
<groupId>com.expedia.www</groupId>
2531
<artifactId>haystack-idl-java</artifactId>

core/src/main/java/com/expedia/www/haystack/client/dispatchers/RemoteDispatcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
package com.expedia.www.haystack.client.dispatchers;
1818

1919
import com.expedia.www.haystack.client.Span;
20-
import com.expedia.www.haystack.client.dispatchers.clients.Client;
21-
import com.expedia.www.haystack.client.dispatchers.clients.ClientException;
2220
import com.expedia.www.haystack.client.metrics.*;
2321
import com.expedia.www.haystack.client.metrics.Timer.Sample;
22+
import com.expedia.www.haystack.remote.clients.Client;
23+
import com.expedia.www.haystack.remote.clients.ClientException;
2424
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
2525
import org.apache.commons.lang3.builder.ToStringStyle;
2626
import org.slf4j.Logger;

core/src/main/java/com/expedia/www/haystack/client/dispatchers/clients/GRPCAgentClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.expedia.www.haystack.client.metrics.Metrics;
2626
import com.expedia.www.haystack.client.metrics.MetricsRegistry;
2727
import com.expedia.www.haystack.client.metrics.Timer.Sample;
28+
import com.expedia.www.haystack.remote.clients.BaseGrpcClient;
29+
import com.expedia.www.haystack.remote.clients.ClientException;
2830
import io.grpc.ManagedChannel;
2931
import io.grpc.stub.StreamObserver;
3032

core/src/main/java/com/expedia/www/haystack/client/dispatchers/clients/HttpCollectorClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
import com.expedia.www.haystack.client.Span;
2020
import com.expedia.www.haystack.client.dispatchers.formats.Format;
2121
import com.expedia.www.haystack.client.dispatchers.formats.ProtoBufFormat;
22+
import com.expedia.www.haystack.remote.clients.BaseHttpClient;
23+
import com.expedia.www.haystack.remote.clients.Client;
24+
import com.expedia.www.haystack.remote.clients.ClientException;
2225
import org.apache.http.impl.client.CloseableHttpClient;
2326

2427
import java.util.Collections;

core/src/main/java/com/expedia/www/haystack/client/dispatchers/clients/InMemoryClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.List;
2424
import java.util.concurrent.Semaphore;
2525

26+
import com.expedia.www.haystack.remote.clients.Client;
2627
import org.slf4j.Logger;
2728
import org.slf4j.LoggerFactory;
2829

core/src/main/java/com/expedia/www/haystack/client/dispatchers/clients/LoggerClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.util.Arrays;
2020

21+
import com.expedia.www.haystack.remote.clients.Client;
2122
import org.slf4j.Logger;
2223
import org.slf4j.LoggerFactory;
2324

core/src/main/java/com/expedia/www/haystack/client/dispatchers/clients/NoopClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.expedia.www.haystack.client.dispatchers.clients;
1818

1919
import com.expedia.www.haystack.client.Span;
20+
import com.expedia.www.haystack.remote.clients.Client;
2021

2122
public class NoopClient implements Client<Span> {
2223

core/src/test/java/com/expedia/www/haystack/client/dispatchers/clients/HttpCollectorClientTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.expedia.www.haystack.client.Tracer;
2323
import com.expedia.www.haystack.client.dispatchers.InMemoryDispatcher;
2424
import com.expedia.www.haystack.client.metrics.NoopMetricsRegistry;
25+
import com.expedia.www.haystack.remote.clients.ClientException;
2526
import org.apache.http.ProtocolVersion;
2627
import org.apache.http.client.methods.CloseableHttpResponse;
2728
import org.apache.http.client.methods.HttpPost;

haystack-remote-clients/pom.xml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>com.expedia.www</groupId>
7+
<artifactId>haystack-client-java-parent</artifactId>
8+
<version>0.2.7-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>haystack-remote-clients</artifactId>
12+
<packaging>jar</packaging>
13+
<name>haystack-remote-clients</name>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>com.expedia.www</groupId>
18+
<artifactId>haystack-idl-java</artifactId>
19+
</dependency>
20+
21+
<dependency>
22+
<groupId>com.expedia.www</groupId>
23+
<artifactId>haystack-client-metrics-api</artifactId>
24+
<version>${project.version}</version>
25+
</dependency>
26+
27+
<dependency>
28+
<groupId>io.grpc</groupId>
29+
<artifactId>grpc-netty-shaded</artifactId>
30+
</dependency>
31+
32+
<dependency>
33+
<groupId>io.grpc</groupId>
34+
<artifactId>grpc-protobuf</artifactId>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>io.grpc</groupId>
39+
<artifactId>grpc-stub</artifactId>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>org.apache.commons</groupId>
44+
<artifactId>commons-lang3</artifactId>
45+
</dependency>
46+
47+
<dependency>
48+
<groupId>org.slf4j</groupId>
49+
<artifactId>slf4j-api</artifactId>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>org.apache.httpcomponents</groupId>
54+
<artifactId>httpclient</artifactId>
55+
</dependency>
56+
57+
<!-- Test dependencies -->
58+
<dependency>
59+
<groupId>junit</groupId>
60+
<artifactId>junit</artifactId>
61+
<scope>test</scope>
62+
</dependency>
63+
64+
<dependency>
65+
<groupId>org.mockito</groupId>
66+
<artifactId>mockito-core</artifactId>
67+
<scope>test</scope>
68+
</dependency>
69+
70+
<dependency>
71+
<groupId>io.grpc</groupId>
72+
<artifactId>grpc-testing</artifactId>
73+
<scope>test</scope>
74+
</dependency>
75+
76+
<dependency>
77+
<groupId>org.awaitility</groupId>
78+
<artifactId>awaitility</artifactId>
79+
<scope>test</scope>
80+
</dependency>
81+
</dependencies>
82+
83+
</project>

core/src/main/java/com/expedia/www/haystack/client/dispatchers/clients/BaseGrpcClient.java renamed to haystack-remote-clients/src/main/java/com/expedia/www/haystack/remote/clients/BaseGrpcClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*/
1717

18-
package com.expedia.www.haystack.client.dispatchers.clients;
18+
package com.expedia.www.haystack.remote.clients;
1919

2020
import com.expedia.open.tracing.agent.api.DispatchResult;
2121
import com.expedia.open.tracing.agent.api.SpanAgentGrpc;

0 commit comments

Comments
 (0)