Random hash code is not an option.

I would suggest cache throws exception on update if binary object created
with builder does not have hash code initialized.

Vladimir, can we somehow make it possible to know whether hash code was or
was not inited on a binary object?

--Yakov

2016-03-24 11:43 GMT+03:00 Anton Vinogradov <avinogra...@gridgain.com>:

> Hello,
>
> I found that every BinaryObject created by BinaryObjectBuilder has hashcode
> == 0 by default.
> This can cause situation that all objects created by code similar to:
>
> *BinaryObject key = builder.setField("id", i).build();*
> *streamer.addData(key, key);*
>
> will be stored at one partition and this cause grid performance drop.
>
> Of course user can set hashcode:
>
> *BinaryObject key = builder.setField("id", i).hashCode(random()).build();*
>
> but there is no guarantee that he will.
>
> I propose to generate random hashcode or hashcode based on field's
> hashcodes in case no hashcode set or to warn user somehow that he have to
> specify it.
>
> Thoughts?
>

Reply via email to