public class SBUtil extends Object
| Constructor and Description |
|---|
SBUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addMembershipHook(com.gemstone.gemfire.distributed.internal.membership.MembershipTestHook hook)
Install a test hook to notify test when a force disconnect has occurred.
|
static void |
beHealthy()
Cause this vm to be healthy
|
static void |
beSick()
Cause this vm to be sick
|
static void |
createLocatorTask()
Creates a (disconnected) locator.
|
static void |
dropConnection()
Drop the connection between the two test hosts (host1, host2)
(machines which host the test client and locator VMs).
|
static void |
dropConnection(String src,
String target) |
static void |
dropMultipleConnections()
Drop the multiple connection between the pairs of the hosts specified
using parameter: SplitBrainPrms.hostPairsForConnectionDropRestore
The parameter needs pairs of hostDescriptions with a comma separated list.
|
protected static ClientVmInfo |
getClientVmInfo(String host,
int pid) |
protected static com.gemstone.gemfire.distributed.DistributedMember |
getCoordinator()
get the DistributedMember info for the Current Coordinator
|
static com.gemstone.gemfire.distributed.DistributedMember |
getLeadMember()
get the DistributedMember info for the Current LeadMember
|
static String |
getMyUniqueName()
Uses RemoteTestModule information to produce a name to uniquely identify
a client vm (vmid, clientName, host, pid) for the calling thread
|
static boolean |
isCoordinator()
get eligibleCoordinator info and return true if the calling VM
is the coordinator
|
static boolean |
isLeadMember()
get leadMember info and return true if the calling VM
is the leadMember
|
static void |
killCoordinator()
Kill the current Coordinator
Restriction: This must be called from a client in the same DS as the
LeadMember.
|
static void |
killEligibleCoordinator()
Kill an EligibleCoordinator
Restriction: This must be called from a client in the same DS as the
LeadMember.
|
static void |
killLeadMember()
Kill the current Lead Member
Restriction: This must be called from a client in the same DS as the
LeadMember.
|
static void |
playDead()
Cause this vm to not respond to ARE_YOU_DEAD messages
|
static void |
removeMembershipHook(com.gemstone.gemfire.distributed.internal.membership.MembershipTestHook hook)
Remove a test hook installed by calling SBUtil.addMembershipHook(...).
|
static void |
restoreConnection()
Restore Connectivity between test hosts
The dropType (oneWay vs.
|
static void |
restoreConnection(String src,
String target)
Restore Connectivity between src and target hosts
The dropType (oneWay vs.
|
static void |
restoreMultipleConnections()
Restore connectivity between multiple host pairs.
|
static void |
startAndConnectLocatorTask()
Connects a locator to its distributed system.
|
static void |
stopLocatorTask()
Stops a locator.
|
protected static Object[] |
waitForCoordChange(com.gemstone.gemfire.distributed.DistributedMember member,
int msToSleep)
Given a member, wait for the coordinator member to become different than
the given member.
|
protected static Object[] |
waitForLeadChange(com.gemstone.gemfire.distributed.DistributedMember member,
int msToSleep)
Given a member, wait for the lead member to become different than
the given member.
|
public static final int ONEWAY
public static final int TWOWAY
public static void createLocatorTask()
public static void startAndConnectLocatorTask()
public static void stopLocatorTask()
public static void restoreConnection()
public static void restoreConnection(String src, String target)
public static void restoreMultipleConnections()
public static void killEligibleCoordinator()
public static void killCoordinator()
public static void killLeadMember()
public static void dropConnection()
public static void dropMultipleConnections()
public static boolean isCoordinator()
protected static com.gemstone.gemfire.distributed.DistributedMember getCoordinator()
public static com.gemstone.gemfire.distributed.DistributedMember getLeadMember()
public static boolean isLeadMember()
protected static ClientVmInfo getClientVmInfo(String host, int pid)
protected static Object[] waitForLeadChange(com.gemstone.gemfire.distributed.DistributedMember member, int msToSleep)
member - A distributed member or null. This method waits until
the current lead member is different than this one.msToSleep - The number of millis to sleep between checks for
the lead member.return - A lead member different than member.protected static Object[] waitForCoordChange(com.gemstone.gemfire.distributed.DistributedMember member, int msToSleep)
member - A distributed member or null. This method waits until
the current coordinator member is different than this one.msToSleep - The number of millis to sleep between checks for
the coordinator member.public static String getMyUniqueName()
public static void addMembershipHook(com.gemstone.gemfire.distributed.internal.membership.MembershipTestHook hook)
public static void removeMembershipHook(com.gemstone.gemfire.distributed.internal.membership.MembershipTestHook hook)
public static void beSick()
public static void beHealthy()
public static void playDead()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.