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

Tatu Saloranta commented on CASSANDRA-16851:
--------------------------------------------

[~e.dimitrova] gotcha wrt 3.0; since it is Jackson 1.x, this would not apply 
(and adding Jackson 2.x would do no good; it wouldn't be used). I did not 
realize upgrade happened after 3.0; 3.11 and later use Jackson 2.x.

As to `BufferRecyclers.getJsonStringEncoder()`: it has bit of an "interesting" 
history, and was not meant for use by code outside Jackson.
During Jackson 2.9 there was an attempt for safe recycling of underlying 
buffers of encoder, which lead to complicated handling via `BufferRecyclers`. 
This was removed in 2.10, along with making encoder stateless, but without 
considering compatibility aspects (i.e. removing accessor method).
I added old method back in 2.12.5 to address this.

With Jackson 2.13 (when it gets released), the recommended way is to just call 
`JsonStringEncoder.getInstance()`; there is no buffer recycling (underlying 
buffer is calculated to be about optimal size). With 2.12.x this method is safe 
to use as well.

But for 2.12 I added method `BufferRecyclers.getJsonEncoder()` (and related) 
back for compatibility reasons, but marked "deprecated" so that there would not 
be additional use. It is not meant to indicate imminent removal (methods won't 
be removed before 3.0).

So I think going via `BufferRecyclers` makes sense now and maybe move "back" to 
`JsonStringEncoder.getInstance()` when Cassandra upgrades to Jackson 2.13 or 
later 2.x?

Does above make sense? (the whole thing being a mess, but that aside :) )

 

> Update from Jackson 2.9 to 2.12
> -------------------------------
>
>                 Key: CASSANDRA-16851
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16851
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Dependencies
>            Reporter: Tatu Saloranta
>            Assignee: Tatu Saloranta
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x, 4.0.x, 4.x
>
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> Given that Jackson 2.9 support has ended, it would be good to move at least 
> to the next minor version (2.10, patch 2.10.5) or later – latest stable being 
> 2.12.4.
>  I can test to see if anything breaks, but looking at existing Jackson usage 
> there shouldn't be many issues.
> Assuming upgrade is acceptable there's the question of which branches to 
> apply it to; I will first test it against 4.0.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to