public class EdgeHelper extends Object
| Constructor and Description |
|---|
EdgeHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addThreadLocalConnection(com.gemstone.gemfire.cache.Region r)
Puts the current thread local connection for this thread in the given
region under management, if present.
|
static String |
endpointsToString(List endpoints)
Returns an endpoint string for the given list of endpoints, suitable for
use in "endpoints" properties.
|
static List |
getRandomEndpoints(int numEndpoints,
String distributedSystemName)
Returns a randomized list of the given number of endpoints in the specified
distributed system, chosen from all bridge servers that have registered
endpoints via
BridgeHelper. |
static List |
getRandomEndpointsInWanHctSite(int numEndpoints,
String distributedSystemName)
Returns a randomized list of the given number of endpoints in the
specified distributed system for bridge servers that are in the same
WAN site as the invoking VM, chosen from the servers that have registered
endpoints via
BridgeHelper. |
static List |
getRoundRobinEndpoints(int numEndpoints,
String distributedSystemName)
Returns a round robin list of the given number of endpoints in the
specified distributed system, chosen from all bridge servers that have
registered endpoints via
BridgeHelper. |
static List |
getRoundRobinEndpointsInWanHctSite(int numEndpoints,
String distributedSystemName)
Returns a round robin list of the given number of endpoints in the
specified distributed system for bridge servers that are in the same
WAN site as the invoking VM, chosen from the servers that have registered
endpoints via
BridgeHelper. |
static List |
getRoundRobinLocalHostEndpoints(int numEndpoints,
String distributedSystemName)
Returns a round robin list of the given number of local endpoints in the
specified distributed system, chosen from all bridge servers that have
registered endpoints via
BridgeHelper and live on the local host. |
static List |
getRoundRobinRemoteHostEndpoints(int numEndpoints,
String distributedSystemName)
Returns a round robin list of the given number of remote endpoints in the
specified distributed system, chosen from all bridge servers that have
registered endpoints via
BridgeHelper and live on a different host. |
static List |
getSameEndpoints(int numEndpoints,
String distributedSystemName)
Always returns the same list of the given number of endpoints, chosen from
all bridge servers in the specified distributed system that have
registered endpoints via
BridgeHelper. |
static void |
removeThreadLocalConnection(com.gemstone.gemfire.cache.Region r)
Removes the current thread local connection for this thread in the given
region from management, if present.
|
static void |
restoreThreadLocalConnections()
Restores all managed thread local connections to previously saved ones.
|
static void |
saveThreadLocalConnections()
Saves all managed thread local connections for later restoration.
|
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 List getSameEndpoints(int numEndpoints, String distributedSystemName)
BridgeHelper.
If the number of endpoints is PoolPrms.ALL_AVAILABLE, then all
available endpoints in the distributed system are included, in fixed order.
If the distributed system is null, endpoints 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 endpoints available.public static List getRoundRobinEndpoints(int numEndpoints, String distributedSystemName)
BridgeHelper.
If the number of endpoints is PoolPrms.ALL_AVAILABLE, then all
available endpoints in the distributed system are included, in round robin
order. If the distributed system is null, endpoints are chosen without
regard to their distributed system.
The first client to ask for endpoints gets the endpoints in the order they are returned from the underlying blackboard. The second client gets the endpoints in order starting from the second endpoint and wrapping around if needed. The starting endpoint continues to rotate.
This is a suitable PoolPrms.contactAlgorithm for hierarchical
cache tests that use
HydraRuntimeException - if there are not enough endpoints available.public static List getRoundRobinRemoteHostEndpoints(int numEndpoints, String distributedSystemName)
BridgeHelper and live on a different host.
If the number of endpoints is PoolPrms.ALL_AVAILABLE, then all
available remote endpoints in the distributed system are included, in
round robin order. If the distributed system is null, endpoints are
chosen without regard to their distributed system.
The first client to ask for endpoints gets the remote endpoints in the order they are returned from the underlying blackboard. The second client gets the remote endpoints in order starting from the second endpoint and wrapping around if needed. The starting endpoint continues to rotate.
This is a suitable PoolPrms.contactAlgorithm for multihost
hierarchical cache tests that use
HydraRuntimeException - if there are not enough endpoints available.public static List getRoundRobinLocalHostEndpoints(int numEndpoints, String distributedSystemName)
BridgeHelper and live on the local host.
If the number of endpoints is PoolPrms.ALL_AVAILABLE, then all
available local endpoints in the distributed system are included, in round
robin order. If the distributed system is null, endpoints are chosen
without regard to their distributed system.
The first client to ask for endpoints gets the local endpoints in the order they are returned from the underlying blackboard. The second client gets the local endpoints in order starting from the second endpoint and wrapping around if needed. The starting endpoint continues to rotate.
This is a suitable PoolPrms.contactAlgorithm for multihost
hierarchical cache tests that use
HydraRuntimeException - if there are not enough endpoints available.public static List getRandomEndpoints(int numEndpoints, String distributedSystemName)
BridgeHelper.
If the number of endpoints is PoolPrms.ALL_AVAILABLE, then all
available endpoints in the distributed system are included, in random
order. If the distributed system is null, endpoints 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 endpoints available.public static List getRoundRobinEndpointsInWanHctSite(int numEndpoints, String distributedSystemName)
BridgeHelper.
If the number of endpoints is PoolPrms.ALL_AVAILABLE, then all
matching endpoints in the distributed system are included, in round robin
order. If the distributed system is null, endpoints are chosen without
regard to their distributed system.
The first client to ask for endpoints gets the endpoints in the order they are returned from the underlying blackboard. The second client gets the endpoints in order starting from the second endpoint and wrapping around if needed. The starting endpoint continues to rotate.
This is a suitable PoolPrms.contactAlgorithm for hierarchical
cache tests that use
HydraRuntimeException - if there are not enough endpoints available.public static List getRandomEndpointsInWanHctSite(int numEndpoints, String distributedSystemName)
BridgeHelper.
If the number of endpoints is PoolPrms.ALL_AVAILABLE, then all
matching endpoints in the distributed system are included, in random
order. If the distributed system is null, endpoints 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 endpoints available.public static int toWanSite(String clientName)
ClientPrms.names
as generated by hydraconfig/topology_wan_hct.inc.public static String endpointsToString(List endpoints)
public static void addThreadLocalConnection(com.gemstone.gemfire.cache.Region r)
Use with restoreThreadLocalConnections() and saveThreadLocalConnections() to continue connections across hydra task
boundaries. This is required since GemFire stores connections in Java
threads, not logical hydra threads.
public static void removeThreadLocalConnection(com.gemstone.gemfire.cache.Region r)
public static void restoreThreadLocalConnections()
public static void saveThreadLocalConnections()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.