public class KeyAffinityServiceFactory extends Object
KeyAffinityService
.
Services build by this factory have the following characteristics:
ExecutorFactory
ConsistentHash
function of a distributed cache is used. Service does not make sense for replicated caches.Address
member, a fixed number of keys is generatedKeyAffinityService
Constructor and Description |
---|
KeyAffinityServiceFactory() |
Modifier and Type | Method and Description |
---|---|
static <K,V> KeyAffinityService<K> |
newKeyAffinityService(Cache<K,V> cache,
Collection<Address> filter,
KeyGenerator<K> keyGenerator,
Executor ex,
int keyBufferSize)
|
static <K,V> KeyAffinityService<K> |
newKeyAffinityService(Cache<K,V> cache,
Collection<Address> filter,
KeyGenerator<K> keyGenerator,
Executor ex,
int keyBufferSize,
boolean start)
Creates a service that would only generate keys for addresses specified in filter.
|
static <K,V> KeyAffinityService<K> |
newKeyAffinityService(Cache<K,V> cache,
Executor ex,
KeyGenerator<K> keyGenerator,
int keyBufferSize)
Same as
newKeyAffinityService(org.infinispan.Cache, java.util.concurrent.Executor, KeyGenerator, int,
boolean) with start == true; |
static <K,V> KeyAffinityService<K> |
newKeyAffinityService(Cache<K,V> cache,
Executor ex,
KeyGenerator<K> keyGenerator,
int keyBufferSize,
boolean start)
Creates an
KeyAffinityService instance that generates keys mapped to all addresses
in the cluster. |
static <K,V> KeyAffinityService<K> |
newLocalKeyAffinityService(Cache<K,V> cache,
KeyGenerator<K> keyGenerator,
Executor ex,
int keyBufferSize)
Same as
newLocalKeyAffinityService(org.infinispan.Cache, KeyGenerator, java.util.concurrent.Executor, int, boolean) with start == true. |
static <K,V> KeyAffinityService<K> |
newLocalKeyAffinityService(Cache<K,V> cache,
KeyGenerator<K> keyGenerator,
Executor ex,
int keyBufferSize,
boolean start)
Created an service that only generates keys for the local address.
|
public static <K,V> KeyAffinityService<K> newKeyAffinityService(Cache<K,V> cache, Executor ex, KeyGenerator<K> keyGenerator, int keyBufferSize, boolean start)
KeyAffinityService
instance that generates keys mapped to all addresses
in the cluster. Changes in topology would also noticed: by adding a new node, the service will automatically start
generating keys for it.cache
- the distributed cache for which this service runsex
- used for running async key generation process. On service shutdown, the executor won't be
stopped; i.e. it's user responsibility manage it's lifecycle.keyGenerator
- allows one to control how the generated keys look like.keyBufferSize
- the number of generated keys per Address
.start
- weather to start the service or notKeyAffinityService
implementation.IllegalStateException
- if the supplied cache is not DIST.public static <K,V> KeyAffinityService<K> newKeyAffinityService(Cache<K,V> cache, Executor ex, KeyGenerator<K> keyGenerator, int keyBufferSize)
newKeyAffinityService(org.infinispan.Cache, java.util.concurrent.Executor, KeyGenerator, int,
boolean)
with start == true;public static <K,V> KeyAffinityService<K> newKeyAffinityService(Cache<K,V> cache, Collection<Address> filter, KeyGenerator<K> keyGenerator, Executor ex, int keyBufferSize, boolean start)
filter
- the set of addresses for which to generate keyspublic static <K,V> KeyAffinityService<K> newKeyAffinityService(Cache<K,V> cache, Collection<Address> filter, KeyGenerator<K> keyGenerator, Executor ex, int keyBufferSize)
public static <K,V> KeyAffinityService<K> newLocalKeyAffinityService(Cache<K,V> cache, KeyGenerator<K> keyGenerator, Executor ex, int keyBufferSize, boolean start)
public static <K,V> KeyAffinityService<K> newLocalKeyAffinityService(Cache<K,V> cache, KeyGenerator<K> keyGenerator, Executor ex, int keyBufferSize)
newLocalKeyAffinityService(org.infinispan.Cache, KeyGenerator, java.util.concurrent.Executor, int, boolean)
with start == true.Copyright © 2020 JBoss, a division of Red Hat. All rights reserved.