Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
StopStartVMs(ClientVmInfo aVmId,
int howToStop)
Constructor to specify stop and start.
|
StopStartVMs(ClientVmInfo aVmId,
int howToStop,
boolean doStop,
boolean doStart)
Constructor to specify stop only or start only or both.
|
| Modifier and Type | Method and Description |
|---|---|
static List |
getAllVMs()
Return a List of all ClientVmInfo instances in the StopStartVMs blackboard.
|
static String |
getClientName(Integer vmID)
Get the client name for the given vmID, by looking in the
StopStartBB blackboard shared map.
|
static List |
getMatchVMs(List vmInfoList,
String matchStr)
Get the vms whose client names contain matchStr
|
static Object[] |
getOtherVMs(int numToTarget)
Get a list of "other" vms, along with stop modes.
|
static Object[] |
getOtherVMs(int numToTarget,
String clientMatchStr)
Get a list of "other" vms, along with stop modes.
|
static Object[] |
getOtherVMsDivided()
Return a List of all other vms except for one along with a parallel stop mode
list, and also return the one vm not in the list.
|
static Object[] |
getOtherVMsDivided(String[] excludedClientNames)
Return a List of all other vms except for one along with a parallel stop mode
list, and also return the one vm not in the list.
|
static Object[] |
getOtherVMsWithExclude(int numToTarget,
String clientExcludeStr)
Get a list of "other" vms, along with stop modes.
|
static Object[] |
getOtherVMsWithExcludeVmid(int numToTarget,
String clientMatchStr,
ArrayList<Integer> vmIds)
Get a list of "other" vms, along with stop modes.
|
static void |
joinStopStart(List targetVmList,
List threadList)
Waits for a List of threads concurrently stopping and starting Vms to finish,
as returned by
stopStartAsync(List,List). |
static boolean |
niceKillInProgress()
Returns true if a NICE_KILL is in progress in this VM, false otherwise
|
void |
run()
Run method for this thread: if this thread is set to stop, then
stop a VM and wait for it to stop.
|
static Object[] |
shutDownAllMembers(com.gemstone.gemfire.admin.AdminDistributedSystem adminDS)
Invokes AdminDistributedSystem.shutDownAllMembers() which disconnects
all members but leaves the vms up (because hydra threads remain) including
the possibility of this vm being disconnected, then this actually stops those
vms (except this vm if it was targeted in the shutDownAllMembers...this vm
will remain up but disconnect).
|
static Object[] |
shutDownAllMembers(com.gemstone.gemfire.admin.AdminDistributedSystem adminDS,
List<String> stopModes)
Invokes AdminDistributedSystem.shutDownAllMembers() which disconnects
all members but leaves the vms up (because hydra threads remain) including
the possibility of this vm being disconnected, then this actually stops those
vms (except this vm if it was targeted in the shutDownAllMembers...this vm
will remain up but disconnect).
|
static List |
startAsync(List targetVmList)
Asynchronously start the given vms and return a List of threads that spawned
the start.
|
static void |
startVM(ClientVmInfo vm)
Start a single vm.
|
static void |
startVMs(ClientVmInfo aVM)
Start a single vm.
|
static void |
startVMs(List targetVmList)
Concurrently start a List of Vms.
|
static void |
StopStart_initTask()
An init task to write ClientVmInfo instances to the blackboard, for
use later in choosing vms to stop/start.
|
static List |
stopStartAsync(List targetVmList,
List stopModeList)
Concurrently stops a List of Vms, then restart them.
|
static void |
stopStartOtherVMs(int numToTarget)
Concurrently stop and restart the specified number of VMs, other than this VM.
|
static void |
stopStartVMs(List targetVmList,
List stopModeList)
Concurrently stops a List of VMs, then restarts them.
|
static void |
stopVM(ClientVmInfo vm,
String stopMode)
Stop a single vm.
|
static List |
stopVMs(int numVMsToStop)
Concurrently stop the given number of vms other than this vm.
|
static void |
stopVMs(List targetVmList,
List stopModeList)
Concurrently stop a List of Vms.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic StopStartVMs(ClientVmInfo aVmId, int howToStop)
aVmId - The VmId of the VM to stop then restart.howToStop - The hydra.ClientVmMgr stopMode (unused if stop is false).public StopStartVMs(ClientVmInfo aVmId, int howToStop, boolean doStop, boolean doStart)
aVmId - The VmId of the VM to stop then restart.howToStop - The hydra.ClientVmMgr stopMode (unused if stop is false).public void run()
public static Object[] getOtherVMs(int numToTarget)
numToTarget - The number of VMs to target for a stop/start.TestException - if there aren't numVMsToStop VMs available.public static Object[] getOtherVMs(int numToTarget, String clientMatchStr)
numVMsToTarget - The number of VMs to target for a stop/start.clientMatchStr - A string the must be contained in the client
name to be included in the vms to target, or null.TestException - if there aren't numToTarget VMs available.public static Object[] getOtherVMsWithExclude(int numToTarget, String clientExcludeStr)
numVMsToTarget - The number of VMs to target for a stop/start.clientExcludeStr - Any vm name that contains this string as a
substring is excluded from consideration.TestException - if there aren't numToTarget VMs available.public static Object[] getOtherVMsWithExcludeVmid(int numToTarget, String clientMatchStr, ArrayList<Integer> vmIds)
numVMsToTarget - The number of VMs to target for a stop/start.clientMatchStr - A string the must be contained in the client
name to be included in the vms to target, or null.vmIds - An ArrayList of Integer contains the vmIds not targeted to be stoppedTestException - if there aren't numToTarget VMs available.public static void stopStartOtherVMs(int numToTarget)
numToTarget - The number of VMs, other than this VM, to stop and restart.TestException - if there aren't numToTarget VMs available for stopping.public static void stopStartVMs(List targetVmList, List stopModeList)
stopStartAsync(List,List) followed by joinStopStart(List,List).targetVmList - A list of hydra.ClientVmInfos to stop then restart.stopModeList - A parallel list of stop modes (Strings).public static List stopStartAsync(List targetVmList, List stopModeList)
#joinStopStartThreads(List,List).
Side effects: For any VM which is performing a NICE_KILL because of this call,
it is marked as such in the StopStartBB (blackboard). The blackboard will
contain a key prefixed with util.StopStartVMs.NiceKillInProgress and appended
to with its VmId. The value of this key is the true.
This blackboard entry is for the convenience of the caller, and it is up to the
caller to look for it or not. When a VM undergoes a NICE_KILL, the VM closes the
cache and disconnects from the distributed system. Any threads in that VM doing
work can get exceptions during the close and/or disconnect step. This blackboard
entry is useful for those threads to allow exceptions when they know an exception
is possible.targetVmList - A list of hydra.ClientVmInfos to stop then restart.stopModeList - A parallel list of stop modes (Strings).public static List startAsync(List targetVmList)
#joinStopStartThreads(List,List).targetVmList - A list of hydra.ClientVmInfos to start.public static void joinStopStart(List targetVmList, List threadList)
stopStartAsync(List,List). Resets the niceKill
blackboard entry for each vm is set to false.targetVmList - A list of hydra.ClientVmInfos to stop then restart.threadList - A parallel list of threads on whom to wait.public static boolean niceKillInProgress()
public static void StopStart_initTask()
public static List getAllVMs()
public static void stopVMs(List targetVmList, List stopModeList)
targetVmList - A list of hydra.ClientVmInfos to stop and/or start.stopModeList - A parallel list of stop modes (Strings), if doStop is true.public static List stopVMs(int numVMsToStop)
numVMsToStop - The number of vms other than this vm to stop.public static void startVMs(List targetVmList)
targetVmList - A list of hydra.ClientVmInfos to stop and/or start.public static void startVMs(ClientVmInfo aVM)
targetVM - The VM to start.public static String getClientName(Integer vmID)
vmID - The vmID to get the client name for.public static List getMatchVMs(List vmInfoList, String matchStr)
vmInfoList - A List of ClientVmInfo instances.matchStr - The string to check for in the client names.public static void startVM(ClientVmInfo vm)
vm - The vm to startpublic static void stopVM(ClientVmInfo vm, String stopMode)
vm - The vm to stopstopMode - The stop mode to use when stopping the vm.public static Object[] getOtherVMsDivided()
public static Object[] getOtherVMsDivided(String[] excludedClientNames)
public static Object[] shutDownAllMembers(com.gemstone.gemfire.admin.AdminDistributedSystem adminDS)
adminDS - The admin distributed system instance to use to call
shutdownAllMembers.ClientVmInfo instances describing the VMs that
were stopped.
[1] Set, the return from shutdownAllMembers()com.gemstone.gemfire.admin.AdminException - if the shutDownAllMembers call throws this exception.public static Object[] shutDownAllMembers(com.gemstone.gemfire.admin.AdminDistributedSystem adminDS, List<String> stopModes)
adminDS - The admin distributed system instance to use to call
shutdownAllMembers.stopModes - The stop modes to choose from.ClientVmInfo instances describing the VMs that
were stopped.
[1] Set, the return from shutdownAllMembers()com.gemstone.gemfire.admin.AdminException - if the shutDownAllMembers call throws this exception.Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.