This content has been marked as final.
Show 2 replies
-
1. Re: Key/node affinity - how to get it?
manik Jan 6, 2010 11:20 AM (in response to nivanov)1 of 1 people found this helpfulHi Nikita,
Not sure I understand.
Doing a Cache.get(key) will perform the necessary remote lookups if the key is not mapped to the instance you invoked the method on (and is not in L1 - provided you have enabled L1 caching).
If you want to generate a key such that it will always be stored on a local instance (in addition to N backups), there is currently a feature request for this which will be there in 4.1.0. The JIRA (ISPN-232) contains info on how you could do this yourself for the time being.
HTH,
Manik
-
2. Re: Key/node affinity - how to get it?
mircea.markus Jan 8, 2010 9:43 AM (in response to nivanov)1 of 1 people found this helpfulIf you have the key, you can determine the node(s) on which it resides as follows:
ConsistentHash consistentHash = cache1.getAdvancedCache().getDistributionManager().getConsistentHash();
consistentHash.locate("yourKey",1)