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
Added parameterless ctor to the Serializers to allow load them from hazelcast standard config file. #453
Conversation
…azelcast standard config file. Includes UnitTests to cover both the SerializationUtility atomic functionalities and the whole Hazelcast serialization part.
I forgot to mention I also touched the already existing |
...st/src/main/java/io/github/bucket4j/grid/hazelcast/serialization/SerializationUtilities.java
Show resolved
Hide resolved
Good. I need a time to test this request, especially for case of backward compatibility. |
It would be nice to add paragraph there https://github.com/bucket4j/bucket4j/blob/master/asciidoc/src/main/docs/asciidoc/distributed/jcache/hazelcast.adoc about of serialization configs in standalone cluster. |
import java.util.function.Supplier; | ||
|
||
public class SerializationUtilities { | ||
public static final String TYPE_ID_BASE_PROP_NAME = "Bucket4jSerializers_TypeId_Base"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to rename to "bucket4j.hazelcast.serializer.type_id_base"
…ding to the lib author standard
…roperly configure the custom serialization for a standalone cluster
Just pushed 2 commit in my branch:
|
I am going to release this weekend. |
Nice! |
As suggested by @vladimir-bukhtoyarov during the discussion on the Issue #477 I'm submitting a PR to enable the loading of the Bucke4j custom serializers through the Hazelcast standard configuration file instead of the need to do it programmatically.
A quick disclaimer:
I'm not a skilled java guy and this is the first Spring-less project I'm working on since the University, and I was used to play the brand new "Legend of Zelda: Ocarina of time" at that times!
This PR includes:
SerializationUtility
where I put all the logic to retrieve the typeIdBase based on System Properties or Environment Variables and compute all the typeId for the well-known Serializers based on the offsets declared staticallySerializationUtility
helperHazelcastWithCustomSerializersTest
with a different loading of the hazlecast server using the same hazelcast config primitives used by hazelcast when it loads from configuration file.