Hi,
I think in this case it is requied to enrich EmployeeKey with areaId,
public class OrganizationKey {
private int organizationId;
@AffinityKeyMapped
private int areaId;
}
public class EmployeeKey {
private int employeeId;
private int organizationId;
@AffinityKeyMapped
private int areaId;
}
As result Employee and Organization will be both collocated using area ID
field value.
Sincerely,
Dmitriy Pavlov
вс, 29 окт. 2017 г. в 17:58, Bob Li <[email protected]>:
> Thank Dmity.
>
> I got some mistake in the "OrganizationKey" class and correct them, which
> should be like:
>
> public class OrganizationKey {
> /** ID. */
> private int organizationId;
>
> /** Organization ID. */
> @AffinityKeyMapped
> private int areaId;
> }
>
> I want to collocate those Organization objects with the Area object which
> they belong to.
>
> Then I put those Employee objects and their Organization object together by
> the "EmployeeKey":
> ublic class EmployeeKey {
> private int employeeId;
> /** ID. */
>
> /** Organization ID. */
> @AffinityKeyMapped
> private int organizationId;
>
> }
>
> I followed the above, but didn't work. I have 2 server nodes, and checked
> the distribution of employee objects with the same organizationId which
> were
> saved in 2 nodes.
> BTW, my Ignite version is 2.2 and used page memory cache.
>
> why?
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>