general question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

general question

voipp
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*
Reply | Threaded
Open this post in threaded view
|

Re: general question

Vladimir Ozerov
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 <[hidden email]
> 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*
>
Reply | Threaded
Open this post in threaded view
|

Re: general question

voipp
What is schema in your context?

пн, 13 февр. 2017 г. в 10:50, Vladimir Ozerov <[hidden email]>:

> 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 <
> [hidden email]
> > 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*
Reply | Threaded
Open this post in threaded view
|

Re: general question

Vladimir Ozerov
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 <
[hidden email]> wrote:

> What is schema in your context?
>
> пн, 13 февр. 2017 г. в 10:50, Vladimir Ozerov <[hidden email]>:
>
> > 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 <
> > [hidden email]
> > > 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*
>