public class GridCacheDefaultAffinityKeyMapper extends Object implements AffinityKeyMapper
AffinityKeyMapped,
then the value of annotated field will be used to get affinity value instead
of the key itself. If there is no annotation, then the key is used as is.
Convenience affinity key adapter, AffinityKey can be used in
conjunction with this mapper to automatically provide custom affinity keys for cache keys.
If non-default affinity mapper is used, is should be provided via
CacheConfiguration.getAffinityMapper() configuration property.
| Modifier and Type | Field and Description |
|---|---|
protected Ignite |
ignite
Injected ignite instance.
|
protected IgniteLogger |
log
Logger.
|
| Constructor and Description |
|---|
GridCacheDefaultAffinityKeyMapper() |
| Modifier and Type | Method and Description |
|---|---|
Object |
affinityKey(Object key)
If key class has annotation
AffinityKeyMapped,
then the value of annotated method or field will be used to get affinity value instead
of the key itself. |
String |
affinityKeyPropertyName(Class<?> cls) |
void |
ignite(Ignite ignite) |
void |
reset()
Resets cache affinity mapper to its initial state.
|
protected transient Ignite ignite
@LoggerResource protected transient IgniteLogger log
public Object affinityKey(Object key)
AffinityKeyMapped,
then the value of annotated method or field will be used to get affinity value instead
of the key itself. If there is no annotation, then the key is returned as is.affinityKey in interface AffinityKeyMapperkey - Key to get affinity key for.@Nullable public String affinityKeyPropertyName(Class<?> cls)
cls - Key class.@IgniteInstanceResource public void ignite(Ignite ignite)
ignite - Ignite.public void reset()
reset in interface AffinityKeyMapper
Follow @ApacheIgnite
Ignite Fabric : ver. 2.5.0 Release Date : May 23 2018