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

Maxim Muzafarov edited comment on CASSANDRA-14667 at 6/7/23 4:58 PM:
---------------------------------------------------------------------

Hello everyone,

I have researched the problem and found a few options that might also work 
(none of which are good). Firstly, the problem with just bumping up the 
Dropwizard version is that the {{JmxPerporter}} class has moved from the 
{{com.codahale.metrics}} package in the 3.x version to the 
{{com.codahale.metrics.*jmx*}} package in the 4.x version. We can remove the 
dependency of the Cassandra itself from the {{JmxPerporter}} class (I've done 
this in the PR), but the cassandra-driver-core 3.1.1 (used in tests now) 
requires this class in the classpath to run and as the class has changed the 
package we are seeing the ClassNotFoundException.

So what we can do here:

# Stefan has mentioned adding the _withoutMetrics()_, this will solve the 
problem, I guess this limits us to using metrics in tests until the driver is 
updated;
# I've linked the problems to the driver upgrade: CASSANDRA-15750, 
CASSANDRA-17231. This will allow us to easily update the Dropwizard right after 
the driver version changes;
# We can use the maven-shade-plugin to relocate classes from the metrics-jmx 
(the {{JmxPerporter}} has been moved to it) from com.codahale.metrics.*jmx* to 
the com.codahale.metrics package. This copies the classes bytecode into a new 
package and create an additional jar. As these classes are fully compatible 
(only the package has changed), they can be used by the 3.1.1 driver from the 
classpath as they are now used. Drawbacks: maven is used for the build, I 
haven't found a corresponding ant for it;
# I've been thinking that as the Dropwizard has the Apache 2.0 licences, we can 
copy the {{JmxPerporter}} to our tests (and to the classpath accordingly) with 
the _right_ package, so that the required classes will be in the classpath to 
run our tests with the old driver until the driver is updated.

I think the first option is our best choice, right?
Thoughts?


 


was (Author: mmuzaf):
Hello everyone,

I have researched the problem and found a few options that might also work 
(none of which are good). Firstly, the problem with just bumping up the 
Dropwizard version is that the {{JmxPerporter}} class has moved from the 
{{com.codahale.metrics}} package in the 3.x version to the 
{{com.codahale.metrics.*jmx*}} package in the 4.x version. We can remove the 
dependency of the Cassandra itself from the {{JmxPerporter}} class (I've done 
this in the PR), but the cassandra-driver-core 3.1.1 (used in tests now) 
requires this class in the classpath to run and as the class has changed the 
package we are seeing the ClassNotFoundException.

So what we can do here:

# Stefan has mentioned adding the _withoutMetrics()_, this will solve the 
problem, I guess this limits us to using metrics in tests until the driver is 
updated;
# I've linked the problems to the driver upgrade: CASSANDRA-15750, 
CASSANDRA-17231. This will allow us to easily update the Dropwizard right after 
the driver version changes;
# We can use the maven-shade-plugin to relocate classes from the metrics-jmx 
(the {{JmxPerporter}} has been moved to it) from com.codahale.metrics.*jmx* to 
the com.codahale.metrics package. This copies the classes bytecode into a new 
package and create an additional jar. As these classes are fully compatible 
(only the package has changed), they can be used by the 3.1.1 driver from the 
classpath as they are now used. Drawbacks: maven is used for the build, I 
haven't found a corresponding ant for it;

I think the first option is our best choice, right?
Thoughts?


 

> 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