ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amitpa <ami...@nrifintech.com>
Subject Re: Affinity Key Mapping
Date Fri, 27 May 2016 03:33:51 GMT
Hey Thanks for the reply.

I am copying the example here :- 

/ Instantiate person keys with the same company ID which is used as affinity
key.
Object personKey1 = new PersonKey("myPersonId1", "myCompanyId");
Object personKey2 = new PersonKey("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);

>From the example it doesnt appear that we can put it in different caches.
See both are putting to the same cache.

Is there any exampel of using different caches for storing related domain
objects, how does Ignite figure out colocation in that case? Sorry for the
questions, but it got me confused.

Also how do you configure partitions for a cache?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-Key-Mapping-tp5212p5265.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message