public class ClientMgr extends Object
| Constructor and Description |
|---|
ClientMgr() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
_reboot(String srcName,
int srcVmid,
int srcActionId,
String reason,
RebootInfo target)
Reboots the target host.
|
protected static void |
_startClientVm(String srcName,
int srcVmid,
int srcActionId,
String reason,
int syncMode,
ClientVmInfo target)
Starts the target client VM.
|
protected static void |
_stopClientVm(String srcName,
int srcVmid,
int srcActionId,
String reason,
int syncMode,
int stopMode,
int startMode,
ClientVmInfo target)
Stops the target client VM.
|
protected static ClientVmRecord |
bounceUnitTestVm(int pid)
Does kill type stops for unit test vms followed by immediate restart.
|
protected static boolean |
clientVmsPermanentlyStopped() |
protected static Map |
createClients(Collection cds,
Map tgs)
Creates client vm records from a set of client descriptions and
threadgroups.
|
static List<List<String>> |
getClientMapping()
Returns the client mapping.
|
protected static ClientVmRecord |
getClientVm(int vmid)
Returns client vm records with the given id from the master list.
|
protected static Vector |
getClientVmids()
Returns the VM IDs (as Integers) for all client VMs, regardless of whether
the VMs are currently started or stopped.
|
static Map |
getClientVms()
Returns the master list of client vm records (vmid,vm).
|
protected static Vector |
getOtherClientVmids(int vmid)
Returns the VM IDs (as Integers) for all client VMs except the given one,
regardless of whether the VMs are currently started or stopped.
|
protected static int |
getPid(int vmid)
Used by new client processes to get an accurate PID (needed for Linux)
before they start their client threads.
|
protected static Integer |
getVmid(int pid)
Used by hydra clients to get the VM ID corresponding to a PID.
|
protected static Integer |
getVmid(String host,
int pid)
Used by hydra clients to get the VM ID corresponding to a host and PID.
|
protected static boolean |
hasDynamicActions()
Returns true if there are uninterruptible dynamic actions.
|
static void |
printProcessStacks()
Prints process stacks for all live client vms.
|
protected static void |
printProcessStacks(ClientVmRecord vm)
Prints process stacks for a specific client vm.
|
protected static void |
reboot(String srcName,
int srcVmid,
int srcActionId,
String reason,
RebootInfo target)
Reboots the target host.
|
protected static void |
refuseDynamicActions()
Tells the test to refuse any further dynamic actions.
|
static HydraThreadGroupInfo |
registerClient(int vmid,
int tid,
RemoteTestModuleIF mod)
Used by new client threads to tell master they are ready and to get their
threadgroup information.
|
static void |
registerClientDisconnect(int vmid)
Used by a dynamic action thread to tell master a JVM has finished
disconnecting.
|
protected static ClientVmInfo |
reserveClientVmForStart(String srcName,
int srcVmid,
ClientVmInfo target)
Reserves a client VM matching the specified target info for future start.
|
protected static ClientVmInfo |
reserveClientVmForStop(String srcName,
int srcVmid,
int syncMode,
int stopMode,
ClientVmInfo target)
Reserves a client VM matching the specified target info for future stop.
|
protected static RebootInfo |
reserveForReboot(String srcName,
int srcVmid,
String target,
boolean liveOnly)
Reserves the host for future reboot.
|
protected static void |
runClientShutdownHooks(Map vms)
run client shutdown hooks without shutting down the clients
|
protected static void |
startClients(String purpose,
Map vms)
Fires up the given client vms for the stated purpose.
|
protected static void |
startClientVm(String srcName,
int srcVmid,
int srcActionId,
String reason,
int syncMode,
ClientVmInfo target)
Starts the target client VM.
|
protected static void |
stopClients(Map vms,
boolean closeConnection,
boolean runShutdownHook)
Tells the given client vms to exit.
|
protected static void |
stopClientVm(String srcName,
int srcVmid,
int srcActionId,
String reason,
int syncMode,
int stopMode,
int startMode,
ClientVmInfo target)
Stops the target client VM.
|
protected static void |
waitForClientsToDie(Map vms)
Waits
Prms.maxClientShutdownWaitSec for the given client vms
to come down. |
protected static void |
waitForClientsToRegister(Map vms)
Waits
Prms.maxClientStartupWaitSec for the given client vms
to register all their client threads with master. |
protected static void |
waitForClientToDisconnect(ClientVmRecord vm)
Waits
Prms.maxClientShutdownWaitSec for the given client vm
to disconnect. |
protected static ClientVmRecord getClientVm(int vmid)
public static Map getClientVms()
protected static Map createClients(Collection cds, Map tgs)
protected static void startClients(String purpose, Map vms)
protected static void waitForClientsToRegister(Map vms)
Prms.maxClientStartupWaitSec for the given client vms
to register all their client threads with master.protected static Integer getVmid(String host, int pid)
protected static Integer getVmid(int pid)
protected static int getPid(int vmid)
public static HydraThreadGroupInfo registerClient(int vmid, int tid, RemoteTestModuleIF mod)
public static void registerClientDisconnect(int vmid)
protected static void stopClients(Map vms, boolean closeConnection, boolean runShutdownHook)
Disconnect should only be used if all client threads are finished doing work, to prevent spurious error reporting.
protected static void runClientShutdownHooks(Map vms)
protected static void waitForClientsToDie(Map vms)
Prms.maxClientShutdownWaitSec for the given client vms
to come down.protected static void waitForClientToDisconnect(ClientVmRecord vm)
Prms.maxClientShutdownWaitSec for the given client vm
to disconnect.public static void printProcessStacks()
protected static void printProcessStacks(ClientVmRecord vm)
protected static ClientVmInfo reserveClientVmForStop(String srcName, int srcVmid, int syncMode, int stopMode, ClientVmInfo target) throws ClientVmNotFoundException
srcName - Thread name for the invoking client.srcVmid - Logical VM id for the invoking client.syncMode - Synchronization mode for the dynamic stop.stopMode - Stop mode for the dynamic stop.target - Information used to select the target client VM.ClientVmNotFoundException - if no match could be made.IllegalArgumentException - if the target info is inconsistent
with any known VM or forces deadlock.DynamicActionException - if the test is terminating and refuses to
allow any further dynamic actions.protected static ClientVmInfo reserveClientVmForStart(String srcName, int srcVmid, ClientVmInfo target) throws ClientVmNotFoundException
srcName - Thread name for the invoking client.srcVmid - Logical VM id for the invoking client.target - Information used to select the target client VM.ClientVmNotFoundException - if no match could be made.IllegalArgumentException - if the target info is inconsistent
with any known VM.DynamicActionException - if the test is terminating and refuses to
allow any further dynamic actions.protected static void stopClientVm(String srcName, int srcVmid, int srcActionId, String reason, int syncMode, int stopMode, int startMode, ClientVmInfo target)
Creates and runs a thread to carry out the action asynchronously on behalf of the master. If the action is synchronous, it uses a remote signal to notify the source when it is complete. All exceptions are handled in the thread. None are thrown back to the client. Clients are left to time out on their own in the case of a hang.
protected static void startClientVm(String srcName, int srcVmid, int srcActionId, String reason, int syncMode, ClientVmInfo target)
Creates and runs a thread to carry out the action asynchronously on behalf of the master. If the action is synchronous, it uses a remote signal to notify the source when it is complete. All exceptions are handled in the thread. None are thrown back to the client. Clients are left to time out on their own in the case of a hang.
protected static void _stopClientVm(String srcName, int srcVmid, int srcActionId, String reason, int syncMode, int stopMode, int startMode, ClientVmInfo target)
protected static void _startClientVm(String srcName, int srcVmid, int srcActionId, String reason, int syncMode, ClientVmInfo target)
protected static ClientVmRecord bounceUnitTestVm(int pid) throws RemoteException
RemoteExceptionprotected static Vector getClientVmids()
protected static Vector getOtherClientVmids(int vmid)
protected static boolean clientVmsPermanentlyStopped()
protected static void refuseDynamicActions()
protected static boolean hasDynamicActions()
protected static RebootInfo reserveForReboot(String srcName, int srcVmid, String target, boolean liveOnly) throws RebootHostNotFoundException
srcName - Thread name for the invoking client.srcVmid - Logical VM id for the invoking client.target - The host to reboot.liveOnly - Whether to return only processes that were live at reboot.RebootHostNotFoundException - if the host is not available.IllegalArgumentException - if the host is not used in the test.DynamicActionException - if the test is terminating and refuses to
allow any further dynamic actions.protected static void reboot(String srcName, int srcVmid, int srcActionId, String reason, RebootInfo target)
Creates and runs a thread to carry out the action asynchronously on behalf of the master. Since the action is synchronous, it uses a remote signal to notify the source when it is complete. All exceptions are handled in the thread. None are thrown back to the client. Clients are left to time out on their own in the case of a hang.
protected static void _reboot(String srcName, int srcVmid, int srcActionId, String reason, RebootInfo target)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.