hi,
I have tried to implement the cache with Affinity Collocation
Object personKey1 = new AffinityKey("myPersonId1",
"myCompanyId");Object personKey2 = new AffinityKey("myPersonId2",
"myCompanyId");
Person p1 = new Person(personKey1, ...);Person p2 = new
Person(personKey2, ...);
// Both, the company and the person objects will be cached on the
same node.cache.put("myCompanyId", new
Company(..));cache.put(personKey1, p1);cache.put(personKey2, p2);
I have successfully put the company and its relevant Person into the same
node.
But, I cannot get the expected numbers of records from the cache.
I have 3 server nodes, 2 company (Company A, Company B), each company has 4
persons.
Server1 : CompanyA, P1, P2, P3, P4
Server2 : NULL
Server3 : CompanyB , P11, P12, P13, P14
I did the query task in the web console.
select * from Campany as c left join Person as p on c.comp_id = p.comp_id
Actual Result: 2, Expected: 8
The interesting part is that the result return of contains data from
Company only but not the data from Person.
I have tried to repeat the query node by node. it returns 4 records in
server1 and 0 records in server 2 and 4 records in server3, which are the
expected.
I am not sure what is going wrong.