ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Rudyak <irud...@gmail.com>
Subject Re: BinaryObjects and hashCode()
Date Mon, 19 Jun 2017 23:59:15 GMT
If the server doesn't calculate hash code how it then should work for
objects which expired from cache and were pushed to persistent store?

As far as persistent store methods (loadCache, load, loadAll) will be
executed on server side it looks like server should have custom logic for
hashCode() and equals().


Igor

On Mon, Jun 19, 2017 at 3:45 PM, Dmitriy Setrakyan <dsetrakyan@apache.org>
wrote:

> Igor,
>
> As far as I know, the hash code would be calculated on the client side and
> sent over within the binary format. Server does not calculate the hash
> code.
>
> D.
>
> On Tue, Jun 20, 2017 at 12:08 AM, Igor Rudyak <irudyak@gmail.com> wrote:
>
> > Hi,
> >
> > I am using simple POJO objects as key/value pair for my Ignite cache.
> Also
> > I would like to store objects as BinaryObjects. Thus Ignite cache was
> > created using:
> >
> > *mycache = ignite.getOrCreateCache("mycache").withKeepBinary()*
> >
> > When I am trying to put objects in the cache I am receiving such an
> error:
> >
> > *java.lang.IllegalArgumentException: Cache key must override hashCode()
> > and
> > equals() methods: com.test.MyKey*
> >
> > Isn't this contradicts to *BinaryObjects* concept? As far as there are no
> > *com.test.MyKey* class deployed on the server side all implemented class
> > methods (including *hashCode* and *equals*) are useless, cause they will
> > not be available on the server.
> >
> > Igor
> >
>

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