You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by ALEKSEY KUZNETSOV <al...@gmail.com> on 2017/02/10 16:06:16 UTC
general question
Guys, i have a question.Why do we store fields position information in
FieldAccessor before hashcode evaluation? Test example is in
: org.apache.ignite.internal.binary.BinaryFieldIdentityResolverSelfTest#testHashCode
--
*Best Regards,*
*Kuznetsov Aleksey*
Re: general question
Posted by Vladimir Ozerov <vo...@gridgain.com>.
Please have a look at BinarySchema and it's usages. Essentially this is a
fingerprint of object fields in the order they were serialized, represented
as [field name] -> [position] hash map. Consider and object with 3 fields -
A, B, C. There could be 6 different schemas for it: [A, B, C], [A, C, B],
[B, A, C], [B, C, A]. [C, A, B], [C, B, A].
We use schemas to achieve O(1) field lookup time.
On Mon, Feb 13, 2017 at 11:05 AM, ALEKSEY KUZNETSOV <
alkuznetsov.sb@gmail.com> wrote:
> What is schema in your context?
>
> пн, 13 февр. 2017 г. в 10:50, Vladimir Ozerov <vo...@gridgain.com>:
>
> > Alex,
> >
> > FieldAccessor stores field positions for the given schema to allow for
> fast
> > field value lookup.
> >
> > On Fri, Feb 10, 2017 at 7:06 PM, ALEKSEY KUZNETSOV <
> > alkuznetsov.sb@gmail.com
> > > wrote:
> >
> > > Guys, i have a question.Why do we store fields position information in
> > > FieldAccessor before hashcode evaluation? Test example is in
> > > : org.apache.ignite.internal.binary.BinaryFieldIdentityResolverSel
> > > fTest#testHashCode
> > > --
> > >
> > > *Best Regards,*
> > >
> > > *Kuznetsov Aleksey*
> > >
> >
> --
>
> *Best Regards,*
>
> *Kuznetsov Aleksey*
>
Re: general question
Posted by ALEKSEY KUZNETSOV <al...@gmail.com>.
What is schema in your context?
пн, 13 февр. 2017 г. в 10:50, Vladimir Ozerov <vo...@gridgain.com>:
> Alex,
>
> FieldAccessor stores field positions for the given schema to allow for fast
> field value lookup.
>
> On Fri, Feb 10, 2017 at 7:06 PM, ALEKSEY KUZNETSOV <
> alkuznetsov.sb@gmail.com
> > wrote:
>
> > Guys, i have a question.Why do we store fields position information in
> > FieldAccessor before hashcode evaluation? Test example is in
> > : org.apache.ignite.internal.binary.BinaryFieldIdentityResolverSel
> > fTest#testHashCode
> > --
> >
> > *Best Regards,*
> >
> > *Kuznetsov Aleksey*
> >
>
--
*Best Regards,*
*Kuznetsov Aleksey*
Re: general question
Posted by Vladimir Ozerov <vo...@gridgain.com>.
Alex,
FieldAccessor stores field positions for the given schema to allow for fast
field value lookup.
On Fri, Feb 10, 2017 at 7:06 PM, ALEKSEY KUZNETSOV <alkuznetsov.sb@gmail.com
> wrote:
> Guys, i have a question.Why do we store fields position information in
> FieldAccessor before hashcode evaluation? Test example is in
> : org.apache.ignite.internal.binary.BinaryFieldIdentityResolverSel
> fTest#testHashCode
> --
>
> *Best Regards,*
>
> *Kuznetsov Aleksey*
>