ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Ozerov <voze...@gridgain.com>
Subject Re: Externalizable in cache
Date Tue, 16 Feb 2016 11:46:17 GMT
Myron,
Thank you for pointing this. it looks like we violate stream contract
because regular Java ObjectOutputStream will return -1 in this case.
Forwarding to dev list.

Igniters,
As Myron mentioned, out implementation of ObjectInput returns 0 when
performing ObjectInput.read(byte[]) and there is no more array data
available. To the contrast, Java's ObjectInputStream returns -1 in this
case.
Looks like we should fix that.

Thoughts?

Vladimir.

On Mon, Feb 15, 2016 at 10:32 PM, Myron Chelyada <myron.chelyada@gmail.com>
wrote:

> Hello Alexey,
>
> This is actually not real code but just extracted part for test. That's
> why it looks incorrect.
> And I've already captured infinite loop because of 0 being returned. And
> imagine use case when I need to read until end of stream. So question is
> why 0 is returned but not -1 (according to API).
>
>
> 2016-02-15 21:10 GMT+02:00 Dmitriy Setrakyan <dsetrakyan@apache.org>:
>
>> Alexey, is this something that Ignite could prevent automatically?
>>
>> On Mon, Feb 15, 2016 at 10:17 AM, Alexey Goncharuk <
>> alexey.goncharuk@gmail.com> wrote:
>>
>>> A little correction: in this particular case inputStream does return 0
>>> which leads to an infinite loop, however, generally this may be not the
>>> case, so the implementation should not read beyond object boundary anyways.
>>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message