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

Stefan Miklosovic edited comment on CASSANDRA-16855 at 4/27/23 10:33 AM:
-------------------------------------------------------------------------

I took [~cowtowncoder] 's branch, rebased, resolved conflicts and created a 
draft here (1). It needs to have added tests but I at least rebased it so it is 
on top of the current trunk as 1 commit.

What I see is that we have logic in Json class in 
org.apache.cassandra.cql3.Json package but this class is used all over the 
place, not only in cql3 package. Tatu is not to blame here, there is lot of 
legacy and I think that people just started to use Json class outside of cql3 
package out of convenience. 

More to it, there is also JSON logic in FBUtilities. I suggest we move Json 
class to org.apache.cassandra.utils (where FBUtilities are) and we move all 
JSON related logic in FBUtilities to Json. FBUtilities is centralizing a lot of 
stuff which is completely unrelated and I think that separating JSON code into 
a dedicated class is not a bad idea. At least we slowly make FBUtilities 
smaller.

[~brandon.williams]  [~e.dimitrova]  thoughts?

(1) [https://github.com/apache/cassandra/pull/2297]


was (Author: smiklosovic):
I took [~cowtowncoder] 's branch, rebased, resolved conficts and created a 
draft here (1). It needs to have added tests but I at least rebased it so it is 
on top of the current trunk as 1 commit.

What I see is that we have a logic in Json class in 
org.apache.cassandra.cql3.Json package but this class is used all over the 
place, not only in cql3 package. Tatu is not to blame here, there is lot of 
legacy and I think that people just started to use Json class outside of cql3 
package out of convenience. 

More to it, there is also json logic i FBUtilities. I suggest we move Json 
class to org.apache.cassandra.utils (where FBUtilities are) and we move all 
JSON related login in FBUtilities to Json. FBUtilities is centralizing a lot of 
logic which is completely unrelated and I think that separating JSON stuff into 
a dedicated class is not a bad idea. At least we slowly make FBUtilities 
smaller.

[~brandon.williams]  [~e.dimitrova]  thoughts?

(1) https://github.com/apache/cassandra/pull/2297

> Replace minor use of `json-simple` with Jackson
> -----------------------------------------------
>
>                 Key: CASSANDRA-16855
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16855
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Dependencies, Local/Other, Tool/nodetool
>            Reporter: Tatu Saloranta
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>              Labels: pull-request-available
>             Fix For: 5.x
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Jackson library is used for most JSON reading/writing, but there are couple 
> of places where older "json-simple" library is used, mostly for diagnostics 
> output. Replacing those minor usages would allow removal of a dependency, one 
> for which the last release was made in 2012.
> Places where json-simple is used are:
>  * src/java/org/apache/cassandra/db/ColumnFamilyStore.java
>  * src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
>  * src/java/org/apache/cassandra/hints/HintsDescriptor.java
>  * src/java/org/apache/cassandra/tools/nodetool/stats/StatsPrinter.java
> (and some matching usage in couple of test classes)
> I can take a stab at replacing these uses; it also looks like test coverage 
> may be spotty for some (StatsPrinter json/yaml part has no tests for example).
> It is probably best to target this for "trunk" (4.1?).
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to