You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by krishd <de...@tcs.com> on 2018/09/05 10:50:47 UTC

Re: How to use Affinity Function to Map a set of Keys to a particular node in a cluster?

Hello

I have a similar requirement :
Need particular AffinityKey related data to go to Partitions OF PREDEFINED
NODES ONLY.
For eg.
a PersonCache with 5 partitions distributed across 3 nodes.
The Person object has cityCode as AffinityKeyMapped.  
The Person objects can have any of these 4 cityCodes say : Zurich, London,
Melbourne,Wellingdon
While streaming large number of Person objects into the PersonCache, I want
all persons belonging to Zurich & Melbourne to go to Node1 ,  London to
Node2, Wellingdon to Node3.

Is there a way to enforce this ?

The reason why I need this is because I have a lot of other master/reference
data that is specific to the City and I don't want to load all of that on
all nodes. 

thanks



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

Re: How to use Affinity Function to Map a set of Keys to a particular node in a cluster?

Posted by Mikhail <mi...@gmail.com>.
Hi

You can gather your data by @AffinityKeyMapped in one partition, but you can
not force partition to be stored on some particular node.
So you can use the same @AffinityKeyMapped for all data related to a
particular city and this means all data about this city and/or related to
this city would be on one particular node. However, this means that data
related to London and Zurich might get to the same partition. 
Anyway if you list of cities >1000 distribution would be fiar enough. In the
case of a small set of cities, you can try to implement your own affinity
function, but this isn't an easy task and can take significant time.

Thanks,
Mike.



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