RE: Affinity Key Annotation

2018-02-16 Thread Williams, Michael
Ah, thanks!

From: Alexey Kukushkin [mailto:kukushkinale...@gmail.com]
Sent: Friday, February 16, 2018 5:40 AM
To: user@ignite.apache.org
Subject: Re: Affinity Key Annotation

Michael, data colocation work like this:

  *   Ignite caches have partitions assignments so that primary partitions with 
same ID are assigned to the same physical location (node).
  *   When you put/get data to a cache, Ignite maps value of a field annotated 
with @AffinityKeyMapped to a partition.
  *   Thus, entries having same value of the @AffinityKeyMapped field go to the 
same location.
In your example if recordNo and policyNo are equal then the entries will go to 
the same location.



Re: Affinity Key Annotation

2018-02-16 Thread Alexey Kukushkin
Michael, data colocation work like this:

   - Ignite caches have partitions assignments so that primary partitions
   with same ID are assigned to the same physical location (node).
   - When you put/get data to a cache, Ignite maps value of a field
   annotated with @AffinityKeyMapped to a partition.
   - Thus, entries having same value of the @AffinityKeyMapped field go to
   the same location.

In your example if recordNo and policyNo are equal then the entries will go
to the same location.


RE: Affinity Key Annotation

2018-02-15 Thread Williams, Michael
Imagine, for example, I have four keys:

Public class ThingOneKey
{
@QuerySqlField
@AffinityKeyMapped
int recordNo;
...
}


Public class ThingTwoKey
{
@QuerySqlField
@AffinityKeyMapped
int recordNo;
@QuerySqlField
Date birthday;
...
}

Public class ThingThreeKey
{
@QuerySqlField
@AffinityKeyMapped
int policyNo;
...
}


Public class ThingFourKey
{
@QuerySqlField
@AffinityKeyMapped
int policyNo;
@QuerySqlField
int age;
...
}

I then proceed to create four caches, populated by <ThingOneKey,ThingOne> 
<ThingTwoKey,ThingTwo> <ThingThreeKey,ThingThree> and <ThingFourKey,ThingFour>.

I want ThingOne and ThingTwo, where recordNos are equal to be collocated. 

I also want ThingThree and ThingFour, where policyNos are equal, to be 
collocated. 

If ThingOne has a recordNo that equals a policyNo in ThingThree, will they be 
collocated based on the above? Is there a way to specify I care about the match 
of Things One and Two, but not eg Things Three and Two?

Thanks,
Mike
-Original Message-
From: vkulichenko [mailto:valentin.kuliche...@gmail.com] 
Sent: Thursday, February 15, 2018 4:36 PM
To: user@ignite.apache.org
Subject: Re: Affinity Key Annotation

Mike,

Not sure I understand a question.. Can you show an example of your data model 
and clarify what kind of collocation strategy you want to achieve?

-Val



--
Sent from: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__apache-2Dignite-2Dusers.70518.x6.nabble.com_=DwICAg=9g4MJkl2VjLjS6R4ei18BA=ipRRuqPnuP3BWnXGSOR_sLoARpltax56uFYU6n57c3GFvMdyEV-dz2ez2lZZpYl0=TzuqN8Q89omqLUglrnJEMreTKXCzR3CG2oveHM9lE5s=4TLYKrt3QoPoGXMw3A0x9UDhtyb6mcM6fhUWTya1hAU=



Re: Affinity Key Annotation

2018-02-15 Thread vkulichenko
Mike,

Not sure I understand a question.. Can you show an example of your data
model and clarify what kind of collocation strategy you want to achieve?

-Val



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/