Skip to content

Commit

Permalink
Merge 945183b into daf6f9d
Browse files Browse the repository at this point in the history
  • Loading branch information
malafeev committed Aug 30, 2018
2 parents daf6f9d + 945183b commit 054dadb
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -20,6 +20,9 @@ pom.xml
// Instantiate tracer
Tracer tracer = ...

// Optionally register tracer with GlobalTracer
GlobalTracer.register(tracer);

// Instantiate Cluster Builder
Cluster.Builder builder = Cluster.builder().addContactPoints("127.0.0.1").withPort(9142);

Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Expand Up @@ -62,7 +62,7 @@

<opentracing.version>0.31.0</opentracing.version>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.1</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
<cassandra.version>3.5.1</cassandra.version>
</properties>

Expand All @@ -89,7 +89,7 @@
<dependency>
<groupId>org.cassandraunit</groupId>
<artifactId>cassandra-unit</artifactId>
<version>3.3.0.2</version>
<version>3.5.0.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -109,7 +109,7 @@
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>3.1.0</version>
<version>3.1.2</version>
<scope>test</scope>
</dependency>

Expand All @@ -126,7 +126,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand Down Expand Up @@ -236,7 +236,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
<configuration>
<failOnError>false</failOnError>
</configuration>
Expand Down
Expand Up @@ -21,6 +21,7 @@
import io.opentracing.Tracer;
import io.opentracing.contrib.cassandra.nameprovider.CustomStringSpanName;
import io.opentracing.contrib.cassandra.nameprovider.QuerySpanNameProvider;
import io.opentracing.util.GlobalTracer;

/**
* Tracing decorator for {@link Cluster}
Expand All @@ -36,12 +37,27 @@ public TracingCluster(Initializer initializer, Tracer tracer) {
this.querySpanNameProvider = CustomStringSpanName.newBuilder().build("execute");
}

public TracingCluster(Initializer initializer, Tracer tracer, QuerySpanNameProvider querySpanNameProvider) {
/**
* GlobalTracer is used to get tracer
*/
public TracingCluster(Initializer initializer) {
this(initializer, GlobalTracer.get());
}

public TracingCluster(Initializer initializer, Tracer tracer,
QuerySpanNameProvider querySpanNameProvider) {
super(initializer);
this.tracer = tracer;
this.querySpanNameProvider = querySpanNameProvider;
}

/**
* GlobalTracer is used to get tracer
*/
public TracingCluster(Initializer initializer, QuerySpanNameProvider querySpanNameProvider) {
this(initializer, GlobalTracer.get(), querySpanNameProvider);
}

/**
* {@inheritDoc}
*/
Expand Down
Expand Up @@ -45,6 +45,7 @@ public class CassandraMappingTest {
public void before() throws Exception {
System.setProperty("java.library.path", "src/test/resources/libs");
EmbeddedCassandraServerHelper.startEmbeddedCassandra();
EmbeddedCassandraServerHelper.getSession();
Session session = createSession();
createKeyspace(session);
createTable(session);
Expand Down
Expand Up @@ -54,6 +54,7 @@ public void before() throws Exception {
System.setProperty("java.library.path", "src/test/resources/libs");
mockTracer.reset();
EmbeddedCassandraServerHelper.startEmbeddedCassandra();
EmbeddedCassandraServerHelper.getSession();
}

@After
Expand Down

0 comments on commit 054dadb

Please sign in to comment.