[ 
https://issues.apache.org/jira/browse/CASSANDRA-14667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17703962#comment-17703962
 ] 

Stefan Miklosovic edited comment on CASSANDRA-14667 at 3/23/23 8:21 AM:
------------------------------------------------------------------------

Ahaa I know what is going on ... the Java driver we use for tests itself uses 
Dropwizard of a different version we just stopped to use and imports are 
different suddenly.

driver we are using, of version 3.11.0, uses  
<metrics.version>3.2.2</metrics.version> in 
https://central.sonatype.com/artifact/com.datastax.cassandra/cassandra-driver-parent/3.11.0

This parent 
https://central.sonatype.com/artifact/com.datastax.oss/java-driver-parent/4.15.0
 uses metrics <metrics.version>4.1.18</metrics.version>

However, what we could do is to do this:

{code}
        try (com.datastax.driver.core.Cluster c = 
com.datastax.driver.core.Cluster.builder()
                                                                                
  .withoutMetrics()
                                                                                
  .addContactPoint("127.0.0.1").build();
{code}

Do you see that ".withoutMetrics()" method? Once there, the test passes (e.g. 
tests extending AbstractNetstatsStreaming, modified populateData and 
changeReplicationFactor methods).

So, we either put this "withoutMetrics()" everywhere where we are building 
Cluster, or we update the project to use Cassandra driver 4 (that is pretty 
challenging!)

I am not completely sure if we use these "metrics" via driver, I do not think 
so but should be double checked. I think that for the sake of tests we do not 
need them at all.

The draft where I tried to fix it is here (1). [~mmuzaf] feel free to take and 
build on top of this. Build is being run here (2) but today Jenkins is somehow 
sluggish, lets see what it builds if anything.

(1) https://github.com/apache/cassandra/pull/2240
(2) https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2383/


was (Author: smiklosovic):
Ahaa I know what is going on ... the Java driver we use for tests itself uses 
Dropwizard of a different version we just stopped to use and imports are 
different suddenly.

driver we are using, of version 3.11.0, uses  
<metrics.version>3.2.2</metrics.version> in 
https://central.sonatype.com/artifact/com.datastax.cassandra/cassandra-driver-parent/3.11.0

This parent 
https://central.sonatype.com/artifact/com.datastax.oss/java-driver-parent/4.15.0
 uses metrics <metrics.version>4.1.18</metrics.version>

However, what we could do is to do this:

{code}
        try (com.datastax.driver.core.Cluster c = 
com.datastax.driver.core.Cluster.builder()
                                                                                
  .withoutMetrics()
                                                                                
  .addContactPoint("127.0.0.1").build();
{code}

Do you see that ".withoutMetrics()" method? Once there, the test passes (e.g. 
tests extending AbstractNetstatsStreaming, modified populateData and 
changeReplicationFactor methods).

So, we either put this "withoutMetrics()" everywhere where we are building 
Cluster, or we update the project to use Cassandra driver 4 (that is pretty 
challenging!)

I am not completely sure if we use these "metrics" via driver, I do not think 
so but should be double checked. I think that for the sake of tests we do not 
need them at all.

> Upgrade Dropwizard Metrics to 4.x
> ---------------------------------
>
>                 Key: CASSANDRA-14667
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14667
>             Project: Cassandra
>          Issue Type: Task
>          Components: Observability/Metrics
>            Reporter: Stig Rohde Døssing
>            Assignee: Maxim Muzafarov
>            Priority: Normal
>             Fix For: 5.x
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Cassandra currently uses Metrics 3.1.5. Version 4.0.0 added some fixes for 
> Java 9 compatibility. It would be good to upgrade the Metrics library as part 
> of the version of Cassandra that adds Java 9 compatibility 
> (https://issues.apache.org/jira/browse/CASSANDRA-9608). 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to