Serialization compatibility

42 views
Skip to first unread message

Domenico Di Giulio

unread,
Mar 22, 2021, 6:03:08 AM3/22/21
to fastutil
I am currently using fastuil 8.3.0, and planning to upgrade to 8.5.2. My concern is about compatibility of serialized collections, which may be broken by any fix applied.

Can a fastutil collection serialized with version 8.3.0 be deserialized by version 8.5.2 ? Is there an overall policy with respect to serialization compatibility ?

Here is a list of the classes that I'm using:

it.unimi.dsi.fastutil.longs.Long2ObjectMap.FastEntrySet
it.unimi.dsi.fastutil.longs.Long2ObjectMap
it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap
it.unimi.dsi.fastutil.longs.LongIterator
it.unimi.dsi.fastutil.longs.LongOpenHashSet
it.unimi.dsi.fastutil.longs.LongSet
it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap
it.unimi.dsi.fastutil.objects.Object2LongMap
it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap
it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry
it.unimi.dsi.fastutil.objects.Object2ObjectMap.FastEntrySet
it.unimi.dsi.fastutil.objects.Object2ObjectMap
it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap
it.unimi.dsi.fastutil.objects.ObjectArrayList
it.unimi.dsi.fastutil.objects.ObjectIterator
it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet
it.unimi.dsi.fastutil.objects.ObjectList
it.unimi.dsi.fastutil.objects.ObjectLists
it.unimi.dsi.fastutil.objects.ObjectOpenHashSet
it.unimi.dsi.fastutil.objects.ObjectSet

Thanks for your help.

Sebastiano Vigna

unread,
Mar 23, 2021, 6:25:05 PM3/23/21
to fastutil
Il giorno lunedì 22 marzo 2021 alle 10:03:08 UTC Domenico Di Giulio ha scritto:
I am currently using fastuil 8.3.0, and planning to upgrade to 8.5.2. My concern is about compatibility of serialized collections, which may be broken by any fix applied.

Can a fastutil collection serialized with version 8.3.0 be deserialized by version 8.5.2 ? Is there an overall policy with respect to serialization compatibility ?

Sincerely: not. You have two ways to check this:

- a git diff with 8.3.0, looking for modifications of serialVersionUIDs.
- save with 8.3.0 and load with 8.5.2.

I gave a quick look and I don't think there should be any problem, but to be 100% sure the second test is your best bet.

seba

Domenico Di Giulio

unread,
Mar 24, 2021, 11:36:47 AM3/24/21
to fastutil
Thanks, I tried the following and it worked in both cases with no issues:
- saved with 8.3.0 and loaded with 8.5.2
- saved with 8.5.2 and loaded with 8.3.0

Anyway, I understand there is no policy to keep serialization compatibility across versions.
In the future, would you consider the chance to keep track of any changes that break serialization compatibility in the change log ?

Thanks a lot, you can't imagine how important is this package for us.

Sebastiano Vigna

unread,
Mar 24, 2021, 2:45:36 PM3/24/21
to fastutil
Il giorno mercoledì 24 marzo 2021 alle 15:36:47 UTC Domenico Di Giulio ha scritto:
Thanks, I tried the following and it worked in both cases with no issues:
- saved with 8.3.0 and loaded with 8.5.2
- saved with 8.5.2 and loaded with 8.3.0

Anyway, I understand there is no policy to keep serialization compatibility across versions.
In the future, would you consider the chance to keep track of any changes that break serialization compatibility in the change log ?


Well, actually that's what I do usually. If you peruse CHANGES looking for "break" you'll find a report every time I know there's a break.

Ciao,

seba

 
Reply all
Reply to author
Forward
0 new messages