Reuse Hazelcast Serialization Logic in MapStore Implementation

I implemented my own serializer for my POJOs, using IdentifiedDataSerializableit so that I can support the fine-grained control when classes evolve and new fields need to be added / removed. For some collections, I also need perseverance and implemented MapStoreusing the built-in keystore. My problem is that I would like to use serialization IdentifiedDataSerializablein the implementation MapStore, to use code reuse, and also to ensure the evolution of the class in the future.

I tried to get a link to the internal Hazelcast SerializationService, but it is not easily accessible through the "public" API in HazelcastInstance. In fact, I could not find a decent way to take possession of it.

What I really would like is a version of the interface MapStorethat works at the byte array level, where Hazelcast handles serialization / deserialization before the call. New function request, I think ...

Any ideas on how to solve this problem, meanwhile, are welcome.

+4
source share
1 answer

Divide your question into two parts:

  • Avoiding having to maintain different serialization methods for Hazelcast and the permanent store.

  • - Hazelcast .

:

, Jackson Hazelcast, , MapStore. , .

, Hazelcast, , . MapStore. , ObjectMapper , JSON Smile - , , , Hazelcast. , , . ( "" , JSON, , - !)

, , @JsonAnyGetter @JsonAnySetter, .

"" , .

:

, Hazelcast MapStore, , Hazelcast. , Jackson Kryo, , .

, MapInterceptors IMap<String, byte[]> interceptGet interceptPut. , , Hazelcast .

+3

Source: https://habr.com/ru/post/1530554/


All Articles