org.infinispan.affinity
Class KeyAffinityServiceFactory

java.lang.Object
  extended by org.infinispan.affinity.KeyAffinityServiceFactory

public class KeyAffinityServiceFactory
extends Object

Factory for KeyAffinityService. Services build by this factory have the following characteristics:

Since:
4.1
Author:
Mircea.Markus@jboss.com
See Also:
KeyAffinityService

Constructor Summary
KeyAffinityServiceFactory()
           
 
Method Summary
static
<K,V> KeyAffinityService
newKeyAffinityService(Cache<K,V> cache, Collection<Address> filter, KeyGenerator keyGenerator, Executor ex, int keyBufferSize)
          Same as newKeyAffinityService(org.infinispan.Cache, java.util.Collection, KeyGenerator, java.util.concurrent.Executor, int, boolean) with start == true.
static
<K,V> KeyAffinityService
newKeyAffinityService(Cache<K,V> cache, Collection<Address> filter, KeyGenerator 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 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 keyGenerator, int keyBufferSize, boolean start)
          Creates an KeyAffinityService instance that generates keys mapped to all addresses in the cluster.
static
<K,V> KeyAffinityService
newLocalKeyAffinityService(Cache<K,V> cache, KeyGenerator 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
newLocalKeyAffinityService(Cache<K,V> cache, KeyGenerator keyGenerator, Executor ex, int keyBufferSize, boolean start)
          Created an service that only generates keys for the local address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyAffinityServiceFactory

public KeyAffinityServiceFactory()
Method Detail

newKeyAffinityService

public static <K,V> KeyAffinityService<K> newKeyAffinityService(Cache<K,V> cache,
                                                                Executor ex,
                                                                KeyGenerator keyGenerator,
                                                                int keyBufferSize,
                                                                boolean start)
Creates an 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.

Parameters:
cache - the distributed cache for which this service runs
ex - 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 not
Returns:
an KeyAffinityService implementation.
Throws:
IllegalStateException - if the supplied cache is not DIST.

newKeyAffinityService

public static <K,V> KeyAffinityService<K> newKeyAffinityService(Cache<K,V> cache,
                                                                Executor ex,
                                                                KeyGenerator keyGenerator,
                                                                int keyBufferSize)
Same as newKeyAffinityService(org.infinispan.Cache, java.util.concurrent.Executor, KeyGenerator, int, boolean) with start == true;


newKeyAffinityService

public static <K,V> KeyAffinityService newKeyAffinityService(Cache<K,V> cache,
                                                             Collection<Address> filter,
                                                             KeyGenerator keyGenerator,
                                                             Executor ex,
                                                             int keyBufferSize,
                                                             boolean start)
Creates a service that would only generate keys for addresses specified in filter.

Parameters:
filter - the set of addresses for which to generate keys

newKeyAffinityService

public static <K,V> KeyAffinityService newKeyAffinityService(Cache<K,V> cache,
                                                             Collection<Address> filter,
                                                             KeyGenerator keyGenerator,
                                                             Executor ex,
                                                             int keyBufferSize)
Same as newKeyAffinityService(org.infinispan.Cache, java.util.Collection, KeyGenerator, java.util.concurrent.Executor, int, boolean) with start == true.


newLocalKeyAffinityService

public static <K,V> KeyAffinityService newLocalKeyAffinityService(Cache<K,V> cache,
                                                                  KeyGenerator keyGenerator,
                                                                  Executor ex,
                                                                  int keyBufferSize,
                                                                  boolean start)
Created an service that only generates keys for the local address.


newLocalKeyAffinityService

public static <K,V> KeyAffinityService newLocalKeyAffinityService(Cache<K,V> cache,
                                                                  KeyGenerator keyGenerator,
                                                                  Executor ex,
                                                                  int keyBufferSize)
Same as newLocalKeyAffinityService(org.infinispan.Cache, KeyGenerator, java.util.concurrent.Executor, int, boolean) with start == true.


Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.