public class GridCacheDefaultAffinityKeyMapper extends Object implements CacheAffinityKeyMapper
CacheAffinityKeyMapped,
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 used as is.
Convenience affinity key adapter, CacheAffinityKey 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
CacheAffinityKeyMapped,
then the value of annotated method or field will be used to get affinity value instead
of the key itself. |
void |
reset()
Resets cache affinity mapper to its initial state.
|
@IgniteInstanceResource protected Ignite ignite
@LoggerResource protected transient IgniteLogger log
public Object affinityKey(Object key)
CacheAffinityKeyMapped,
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 CacheAffinityKeyMapperkey - Key to get affinity key for.public void reset()
reset in interface CacheAffinityKeyMapper
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015