@Deprecated public interface AffinityKeyMapper extends Serializable
affinityKey(Object)
method, and the returned value of this method
will be given to AffinityFunction
implementation 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 affinityKey(Object)
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
via CacheConfiguration.getAffinityMapper()
configuration property.
For more information on affinity mapping and examples refer to AffinityFunction
and
@AffinityKeyMapped
documentation.
AffinityFunction
,
AffinityKeyMapped
Modifier and Type | Method and Description |
---|---|
Object |
affinityKey(Object key)
Deprecated.
Maps passed in key to an alternate key which will be used for node affinity.
|
void |
reset()
Deprecated.
Resets cache affinity mapper to its initial state.
|
Object affinityKey(Object key)
key
- Key to map.void reset()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023