-
1. Re: ProtocolBuffers objects in the cache
manik Feb 12, 2010 6:36 AM (in response to yahro)The @Marshallable stuff is internal only (for now). We may make it public API at some point, once we have a proper scheme to ensure magic numbers don't collide.Re: protobufs, the best way to do this is for you to handle the marshalling of values outside of the cache. E.g., Object -> byte[], and then cache.put(key, byte[]).
HTH,
Manik
-
2. Re: ProtocolBuffers objects in the cache
yahro Feb 12, 2010 7:14 AM (in response to manik)Thanks for info, for now I'll stick to using byte[]. In the future it would be nice to be able to use generics e.g.
ConcurrentMap<Integer, SomeProtoBufClass> myTypeSafeCache = manager.getCache("myCache");
In order to do this kind of stuff efficiently, flexible (extensible) serialization mechanism would be helpful.
The simplest solution might be adding configuration parameter to the cache (serializer="mySerializerClass"). Serializer class would implement Infinispan interface, which would declare methods to do conversion Object <-> byte[]. That way everyone could plug whatever they come up with (for instance Protocol Buffer). Just a suggestion .
Best regards,
Jarek