Hi, It is responsibility of AffinityKeyMapper interface implementation. By default Ignite uses GridCacheDefaultAffinityKeyMapper class for this purposes. But you can provide own mapper implementation using CacheConfiguration.setAffinityMapper() method.
On Wed, Jul 13, 2016 at 11:58 AM, November <[email protected]> wrote: > Hi > > I have read http://apacheignite.gridgain.org/docs/affinity-collocation and > java example. > > I don't know how AffinityKey map? Like following code in java example. > How does ignite know EmployeeKey's organizationId should collocate with > Organization's id (not other fields). I can't find anything map them in > configuration. > > Another question: how to use AffinityKey in .Net. Will just replace > @AffinityKeyMapped with [AffinityKeyMapped] work or there is other thing > different? > > public class EmployeeKey { > /** ID. */ > private int id; > > /** Organization ID. */ > @AffinityKeyMapped > private int organizationId; > } > > public class Organization { > /** */ > private static final AtomicLong ID_GEN = new AtomicLong(); > > /** Organization ID (indexed). */ > @QuerySqlField(index = true) > private Long id; > > /** Organization name (indexed). */ > @QuerySqlField(index = true) > private String name; > > /** Address. */ > private Address addr; > > /** Type. */ > private OrganizationType type; > > /** Last update time. */ > private Timestamp lastUpdated; > > } > > > > -- > View this message in context: > http://apache-ignite-users.70518.x6.nabble.com/How-does-AffinityKey-mapped-tp6260.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. > -- Andrey Gura GridGain Systems, Inc. www.gridgain.com
