Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(guava) Better multiset serialization / deserialization #2

Open
cowtowncoder opened this issue Mar 30, 2016 · 3 comments
Open

(guava) Better multiset serialization / deserialization #2

cowtowncoder opened this issue Mar 30, 2016 · 3 comments
Labels
good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project guava

Comments

@cowtowncoder
Copy link
Member

(moved from FasterXML/jackson-datatype-guava#51 by @devinrsmith)

Currently, multisets' serialization size is proportional to Multiset.size() as opposed to Multiset.entrySet().size().

For example, if I have do Multiset.setCount("my_key", 1000), "my_key" is repeated 1000 times in the output. It would be much more appropriate if it behaved liked Map<String, Integer>.


I'm not familiar w/ the intricacies of jackson serialization / deserialization. I'd be pretty surprised if there is widespread use of serializing Multisets (using the existing jackson library)... I would have guessed a lot of other people would be bringing up this exact issue if they were using it. Does jackson ever create hard-breaks in backwards compatibility?

@cowtowncoder
Copy link
Member Author

Typically the way changes like this are handled is by introducing a new on/off Feature (for module or component) which defaults to old behavior, and can be changed to support new handling.
But there are limited number of cases where we have just changed the setting, if we really think there is very low risk of problems.

This might be something to bring up on dev mailing list, esp. since there may be multiple ways data could be structured.

But I can definitely see why change would be useful here; it's just a question of how to best improve the situation.

@superxiao
Copy link

Second this issue. Just come across a production problem where the succinct serialization would be immensely useful. By reading these two posts and realizing jackson does not currently support succinct serialization, I have to move back to Map<T, Long>.

@cowtowncoder
Copy link
Member Author

PRs welcome.

@cowtowncoder cowtowncoder added the good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project label Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project guava
Projects
None yet
Development

No branches or pull requests

3 participants
@cowtowncoder @superxiao and others