Class DefaultKeyAffinityService<K>

java.lang.Object
org.wildfly.clustering.cache.infinispan.embedded.affinity.DefaultKeyAffinityService<K>
Type Parameters:
K - the cache key type
All Implemented Interfaces:
Supplier<BlockingQueue<K>>, org.infinispan.affinity.KeyAffinityService<K>, org.infinispan.commons.api.Lifecycle

public class DefaultKeyAffinityService<K> extends Object implements org.infinispan.affinity.KeyAffinityService<K>, Supplier<BlockingQueue<K>>
A custom key affinity service implementation with the following distinct characteristics (as compared to KeyAffinityServiceImpl):
  • getKeyForAddress(Address) will return a random key (instead of throwing an ISE) if the specified address does not own any segments.
  • Uses a worker thread per address for which to generate keys.
  • Minimal CPU utilization when key queues are full.
  • Non-blocking topology change event handler.
  • getKeyForAddress(Address) calls will not block during topology change events.
Author:
Paul Ferraro