[infinispan-dev] Findings of ISPN-508 - Portable serialization marshaller

Manik Surtani manik at jboss.org
Fri Jul 23 07:42:43 EDT 2010


On 22 Jul 2010, at 11:10, Galder Zamarreño wrote:

> 
> On Jul 22, 2010, at 10:38 AM, Emmanuel Bernard wrote:
> 
>> 
>>>>> The OGM code that deconstructs the object works on a java object (e.g. Person). To be able to use this Person from C++ you'd need to have C++ code to assemble the AtomicMap (i.e. C++ OGM), or?
>>>> 
>>>> Yes
>>> 
>>> Yeah but does not need to be anything complicated. On the client side, it'll be just a custom type that looks exactly like a Map. The difference comes when in the server this is converted into an AtomicMap vs a HashMap.
>> 
>> The serialized conceptual structure of a HashMap is different from the serialized structure of an AtomicMap? Why?
> 
> Depends how you look at it :)
> 
> If you're replicating an AtomicMap to another node in the cluster, we only send deltas around. That's what ReplicableCommandExternalizer does. So, only the stuff that has been modified in the map are sent.
> 
> Now, if we're marshalling to a cache store, we store the underlying map that AtomicHashMap uses, because the cache store would not know how to update the deltas in the map. The same thing would happen with a Hot Rod client, it would just send us the underlying map's entries. 
> 
> At the end of the day, AtomicMap is a map wrapper that allows to track changes to individual deltas and it's treated as an atomic entity.

Sure, but the *serialized* structure of a HashMap and a AHM is exactly the same: it is a dictionary of keys -> values.  So as long as some sort of type identifier/classdef/magic number/whatever can differentiate from the implementation detail, the structure is exactly the same.

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org







More information about the infinispan-dev mailing list