The most straightforward solution which comes to my mind - *do not ever use
BinaryMarshaller by default*. Always fallback to OptimizedMarshaller unless
user explicitly asked us to use binary format (e.g. through package
wildcards).

BTW, we already do this for Externalizable and readObject/writeObject.

On Fri, Dec 18, 2015 at 8:41 PM, Vladimir Ozerov <voze...@gridgain.com>
wrote:

> Ah, I saw your problem with DirectedSpecifics. We need to think about how
> to solve it. Here is the case:
> 1) Class is Serilzable and cannot be changed;
> 2) There are several duplicated field names;
> => BinaryMarshaller cannot handle it.
>
> Any thoughts?
>
> On Fri, Dec 18, 2015 at 8:34 PM, Vladimir Ozerov <voze...@gridgain.com>
> wrote:
>
>> I fixed the problem, it was a bug actually.
>>
>> By default classes which has some custom Java logic (e.g. Externalizable,
>> or with writeObject/readObject methods) will be written using
>> OptimizedMarshaller, so similar field names is not a problem.
>> If you want to serialize such class in binary format and have duplicate
>> field names, you should provide your own BinarySerializer, which will write
>> these fields with different names.
>>
>> On Fri, Dec 18, 2015 at 8:07 PM, Andrey Kornev <andrewkor...@hotmail.com>
>> wrote:
>>
>>> How am I supposed to handle this situation if the class comes from a 3d
>>> party I can't modify?
>>>
>>> Thanks
>>> Andrey
>>>
>>> > Date: Fri, 18 Dec 2015 09:12:22 +0300
>>> > Subject: Re: CacheEntry serialization failure
>>> > From: voze...@gridgain.com
>>> > To: dev@ignite.apache.org
>>> >
>>> > I'll take a look.
>>> >
>>> > On Fri, Dec 18, 2015 at 4:37 AM, Valentin Kulichenko <
>>> > valentin.kuliche...@gmail.com> wrote:
>>> >
>>> > > Folks,
>>> > >
>>> > > It looks like CacheEntry implementation (i.e., the entry that
>>> contains
>>> > > version) can't be properly serialized with the BinaryMarshaller. I
>>> created
>>> > > the test and the ticket:
>>> https://issues.apache.org/jira/browse/IGNITE-2203
>>> > >
>>> > > Can someone take a look?
>>> > >
>>> > > -Val
>>> > >
>>>
>>>
>>
>>
>

Reply via email to