public class PoolHelper extends Object
PoolDescription. Methods are thread-safe.
Pools are lazily created by region creation methods in RegionHelper,
so the pool creation methods here need only be used when not using
RegionHelper to create regions.| Constructor and Description |
|---|
PoolHelper() |
| Modifier and Type | Method and Description |
|---|---|
static com.gemstone.gemfire.cache.client.Pool |
createPool(String poolConfig)
Creates the pool using the given pool configuration.
|
static com.gemstone.gemfire.cache.client.Pool |
createPool(String poolName,
com.gemstone.gemfire.cache.client.PoolFactory factory)
Creates the pool with the given name.
|
static com.gemstone.gemfire.cache.client.Pool |
getPool(String poolName) |
static PoolDescription |
getPoolDescription(String poolConfig)
Returns the
PoolDescription with the given configuration name
from PoolPrms.names. |
static com.gemstone.gemfire.cache.client.PoolFactory |
getPoolFactory(String poolConfig)
Returns a pool factory for the given pool configuration from
PoolPrms.names, configured using the corresponding PoolDescription. |
static List |
getRandomContacts(int numContacts,
String distributedSystemName)
Returns a randomized list of the given number of contacts, chosen from all
server locators in the specified distributed system that have registered
endpoints via
DistributedSystemHelper. |
static List |
getRandomContactsInWanHctSite(int numContacts,
String distributedSystemName)
Returns a randomized list of the given number of contacts for server
locators in the specified distributed system that are in the same WAN site
as the invoking VM, chosen from the server locators that have registered
endpoints via
DistributedSystemHelper. |
static List |
getRoundRobinContacts(int numContacts,
String distributedSystemName)
Returns a round robin list of the given number of contacts, chosen from
all server locators in the specified distributed system that have
registered endpoints via
DistributedSystemHelper. |
static List |
getRoundRobinLocalHostContacts(int numContacts,
String distributedSystemName)
Returns a round robin list of the given number of local contacts,
chosen from all server locators in the specified distributed system
that have registered endpoints via
DistributedSystemHelper
and live on the local host. |
static List |
getRoundRobinRemoteHostContacts(int numContacts,
String distributedSystemName)
Returns a round robin list of the given number of remote contacts, chosen
from all server locators in the specified distributed system that have
registered endpoints via
DistributedSystemHelper and live on a
different host. |
static List |
getSameContacts(int numContacts,
String distributedSystemName)
Always returns the same list of the given number of contacts, chosen from
all server locators in the specified distributed system that have
registered endpoints via
DistributedSystemHelper. |
static String |
poolToString(com.gemstone.gemfire.cache.client.Pool pool)
Returns the given pool as a string.
|
static int |
toWanSite(String clientName)
Extracts the WAN site number from a value of
ClientPrms.names
as generated by hydraconfig/topology_wan_hct.inc. |
public static com.gemstone.gemfire.cache.client.Pool createPool(String poolConfig)
PoolDescription corresponding to the pool
configuration from PoolPrms.names. The name of the pool is the
same as its configuration name.HydraRuntimeException - if an attempt is made to reconfigure an
existing pool.public static com.gemstone.gemfire.cache.client.Pool createPool(String poolName, com.gemstone.gemfire.cache.client.PoolFactory factory)
HydraRuntimeException - if an attempt is made to reconfigure an
existing pool.public static com.gemstone.gemfire.cache.client.Pool getPool(String poolName)
public static String poolToString(com.gemstone.gemfire.cache.client.Pool pool)
public static com.gemstone.gemfire.cache.client.PoolFactory getPoolFactory(String poolConfig)
PoolPrms.names, configured using the corresponding PoolDescription.public static PoolDescription getPoolDescription(String poolConfig)
PoolDescription with the given configuration name
from PoolPrms.names.public static List getSameContacts(int numContacts, String distributedSystemName)
DistributedSystemHelper.
If the number of contacts is PoolPrms.ALL_AVAILABLE, then all
available contacts in the distributed system are included, in fixed order.
If the distributed system is null, contacts are chosen without regard
to their distributed system.
This is a suitable PoolPrms.contactAlgorithm for hierarchical
cache tests that use
HydraRuntimeException - if there are not enough contacts available.public static List getRoundRobinContacts(int numContacts, String distributedSystemName)
DistributedSystemHelper.
If the number of contacts is PoolPrms.ALL_AVAILABLE, then all
available contacts in the distributed system are included, in round robin
order. If the distributed system is null, contacts are chosen without
regard to their distributed system.
The first request for contacts gets the contacts in the order they are returned from the underlying blackboard. The second request gets the contacts in order starting from the second contact and wrapping around if needed. The starting contact continues to rotate.
This is a suitable PoolPrms.contactAlgorithm for hierarchical
cache tests that use
HydraRuntimeException - if there are not enough contacts available.public static List getRoundRobinRemoteHostContacts(int numContacts, String distributedSystemName)
DistributedSystemHelper and live on a
different host.
If the number of contacts is PoolPrms.ALL_AVAILABLE, then all
available remote contacts in the distributed system are included, in round
robin order. If the distributed system is null, contacts are chosen
without regard to their distributed system.
The first client to ask for contacts gets the remote contacts in the order they are returned from the underlying blackboard. The second client gets the remote contacts in order starting from the second contact and wrapping around if needed. The starting contact continues to rotate.
This is a suitable PoolPrms.contactAlgorithm for multihost
hierarchical cache tests that use
HydraRuntimeException - if there are not enough contacts available.public static List getRoundRobinLocalHostContacts(int numContacts, String distributedSystemName)
DistributedSystemHelper
and live on the local host.
If the number of contacts is PoolPrms.ALL_AVAILABLE, then all
available local contacts in the distributed system are included, in round
robin order. If the distributed system is null, contacts are chosen
without regard to their distributed system.
The first client to ask for contacts gets the local contacts in the order they are returned from the underlying blackboard. The second client gets the local contacts in order starting from the second contact and wrapping around if needed. The starting contact continues to rotate.
This is a suitable PoolPrms.contactAlgorithm for multihost
hierarchical cache tests that use
HydraRuntimeException - if there are not enough contacts available.public static List getRandomContacts(int numContacts, String distributedSystemName)
DistributedSystemHelper.
If the number of contacts is PoolPrms.ALL_AVAILABLE, then all
available contacts in the distributed system are included, in random
order. If the distributed system is null, contacts are chosen without
regard to their distributed system.
This is the default PoolPrms.contactAlgorithm. This is a suitable
PoolPrms.contactAlgorithm for hierarchical cache tests that use
HydraRuntimeException - if there are not enough contacts available.public static List getRandomContactsInWanHctSite(int numContacts, String distributedSystemName)
DistributedSystemHelper.
If the number of contacts is PoolPrms.ALL_AVAILABLE, then all
matching contacts in the distributed system are included, in random
order. If the distributed system is null, contacts are chosen without
regard to their distributed system.
This is a suitable PoolPrms.contactAlgorithm for hierarchical
cache tests that use
HydraRuntimeException - if there are not enough contacts available.public static int toWanSite(String clientName)
ClientPrms.names
as generated by hydraconfig/topology_wan_hct.inc.Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.