@Deprecated public interface AffinityKeyMapper extends Serializable
affinityKey(Object)method, and the returned value of this method will be given to
AffinityFunctionimplementation to find out key-to-node affinity.
The default implementation, which will be used if no explicit affinity mapper is specified
in cache configuration, will first look for any field or method annotated with
@AffinityKeyMapped annotation. If such field or method
is not found, then the cache key itself will be returned from
method (this means that all objects with the same cache key will always be routed to the same node).
If such field or method is found, then the value of this field or method will be returned from
affinityKey(Object) method. This allows to specify alternate affinity key, other
than the cache key itself, whenever needed.
A custom (other than default) affinity mapper can be provided
CacheConfiguration.getAffinityMapper() configuration property.
|Modifier and Type||Method and Description|
Maps passed in key to an alternate key which will be used for node affinity.
Resets cache affinity mapper to its initial state.
key- Key to map.