public class RecovDelayTest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected com.gemstone.gemfire.cache.Region |
aRegion |
protected static String |
CONCURRENT_STARTUP |
protected Map |
hostMap |
protected int |
IMMEDIATE |
protected List |
liveVMs |
protected Set |
masterBucketIdSet |
protected List |
masterBucketInfoList |
protected Map |
masterPrMap |
protected int |
NEVER |
protected int |
numDataStoreVMs |
protected ParRegTest |
parRegTestInstance |
protected int |
recoveryDelay |
protected int |
redundantCopies |
protected static String |
redundantCopiesKey |
protected static String |
SERIAL_STARTUP |
protected static String |
START_WITH_ALL |
protected String |
startStrategy |
protected int |
startupRecoveryDelay |
protected boolean |
startupRecoveryRace |
protected List |
stoppedVMs |
protected String |
stopStrategy |
static RecovDelayTest |
testInstance |
protected int |
totalBucketCopies |
protected int |
totalNumVMsToStop |
protected boolean |
uniqueHostTest |
protected static String |
vmIDStr |
protected List |
vmsToStart |
| Constructor and Description |
|---|
RecovDelayTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustRegionSnapshotForLostKeys(Map regionSnapshot) |
protected void |
checkForBalance(Map prMap)
Check for balance:
1) The number of buckets per vm is roughly equal.
|
protected void |
controller()
Main controller for recover delay tests.
|
protected void |
controllerStartVMs()
Start vms, either one at a time or concurrently, with appropriate validation.
|
protected void |
controllerStopVMs()
Stop vms, either one at a time or concurrently, with appropriate validation.
|
protected Set |
getBucketIds(List aBucketList) |
protected Set |
getLostBuckets() |
static void |
HydraTask_checkForBalance()
Checks for rough balance of buckets, keys and primaries.
|
static void |
HydraTask_controller()
Task to control the delay recover test.
|
static void |
HydraTask_initAfterLoad()
Task to control the delay recover test.
|
static void |
HydraTask_initializeAccessor()
Creates and initializes the singleton instance of RecovDelayTest
in this VM and the vm's accessor region.
|
static void |
HydraTask_initializeDataStore()
Creates and initializes the singleton instance of RecovDelayTest
in this VM and the vm's data store region.
|
static void |
HydraTask_initRedundantCopies()
Write the number of redundant copies for the pr to the blackboard
by using the hydra param RecovDelayPrms.redundantCopies, which can be:
"zero" - Write 0 to the blackboard.
|
static void |
HydraTask_load()
Loads the region with keys/values.
|
static void |
HydraTask_waitForStartupRecovery()
If this vm has a startup delay, wait for it.
|
protected void |
initAfterLoad()
Do initialization after the load
|
void |
initializeInstance()
Initialize this test instance
|
void |
initializeRegion(String regDescriptName)
Create a region with the given region description name.
|
protected void |
load()
Load the region with RecovDelayPrms.initialNumKeys.
|
protected List |
stopVMs(List availableVMs,
int numToStop)
Using the list of available vms, stop numToStop vms and return a
List of ClientVmInfos that were stopped.
|
protected void |
validateNoRecovery()
Verify that no recovery has occurred.
|
protected void |
validatePRAfterStarting(List previousLiveVMs,
List vmsStartedThisTime)
Do various checks on the PR after starting:
- check for balance if we recovered
- make sure each bucket has a primary
- verify consistency of PR meta data
- verify data
- verify bucket copy consistency
|
protected void |
validatePRAfterStopping(int numStoppedThisTime)
Do various checks on the PR after stopping:
- make sure each bucket has a primary
- verify consistency of PR meta data
- verify data
- verify bucket copy consistency
|
protected void |
validateRecoveryNow(List vmsExpectingRecovery,
int numRecovPerVM,
boolean isStartupRecovery)
Validate that recovery occurs now.
|
protected void |
validateRecoveryWithDelay(int delayMillis,
List vmsExpectingRecovery,
int numRecovPerVM,
boolean isStartupRecovery)
Validate that recovery occurs after the given delay.
|
protected void |
verifyBucketsInVMs(List emptyVMs,
List nonEmptyVMs)
Verify that the given vms contain no buckets.
|
protected void |
waitForNever()
Wait a sufficient amount of time to satisfy the test that recovery never runs.
|
public static RecovDelayTest testInstance
protected static final String vmIDStr
protected static final String redundantCopiesKey
protected static final String START_WITH_ALL
protected static final String SERIAL_STARTUP
protected static final String CONCURRENT_STARTUP
protected com.gemstone.gemfire.cache.Region aRegion
protected String startStrategy
protected String stopStrategy
protected int recoveryDelay
protected int startupRecoveryDelay
protected int redundantCopies
protected int totalBucketCopies
protected int numDataStoreVMs
protected int totalNumVMsToStop
protected List stoppedVMs
protected List vmsToStart
protected List liveVMs
protected ParRegTest parRegTestInstance
protected List masterBucketInfoList
protected Map masterPrMap
protected Set masterBucketIdSet
protected boolean uniqueHostTest
protected Map hostMap
protected boolean startupRecoveryRace
protected final int NEVER
protected final int IMMEDIATE
public static void HydraTask_initializeDataStore()
public static void HydraTask_initializeAccessor()
public void initializeRegion(String regDescriptName)
regDescriptName - The name of a region description.public void initializeInstance()
protected void initAfterLoad()
public static void HydraTask_load()
public static void HydraTask_checkForBalance()
public static void HydraTask_controller()
public static void HydraTask_initAfterLoad()
public static void HydraTask_initRedundantCopies()
public static void HydraTask_waitForStartupRecovery()
protected void load()
protected void controller()
protected void controllerStopVMs()
protected void controllerStartVMs()
protected void validatePRAfterStopping(int numStoppedThisTime)
numStoppedThisTime - The number of vms stopped the last time vms were stopped.protected void validatePRAfterStarting(List previousLiveVMs, List vmsStartedThisTime)
previousLiveVMs - A List of ClientVmInfo instances of the vms
that were alive prior to starting vmsStartedThisTime.vmsStartedThisTime - A List of ClientVmInfo instances of the vms
started this time.protected void validateNoRecovery()
protected void validateRecoveryNow(List vmsExpectingRecovery, int numRecovPerVM, boolean isStartupRecovery)
vmsExpectingRecovery - A List of either Integers (vmIds) or
ClientVmInfo instances containing vmIds of vms expected to recover.numRecovPerVM - The number of recovery activities expected per
vm in vmsExpectingRecovery.isStartupRecovery - true if the expected recovery is from startup,
false otherwise.protected void validateRecoveryWithDelay(int delayMillis,
List vmsExpectingRecovery,
int numRecovPerVM,
boolean isStartupRecovery)
delayMillis - The delay value in milliseconds.vmsExpectingRecovery - A List of either Integers (vmIds) or
ClientVmInfo instances containing vmIds of vms expected to recover.numRecovPerVM - The number of recovery activities expected per
vm in vmsExpectingRecovery.isStartupRecovery - true if the expected recovery is from startup,
false otherwise.protected void checkForBalance(Map prMap)
prMap - The return from PrState.getPrMap(Region); this
the the PR picture to check.protected void waitForNever()
protected void verifyBucketsInVMs(List emptyVMs, List nonEmptyVMs)
emptyVMs - A List of ClientVmInfo instances or vm ids (Integers).
This vms should contain no buckets. This arg can be null.nonEmptyVMs - A List of ClientVmInfo instances or vm ids (Integers).
This vms should contain buckets. This arg can be null.protected List stopVMs(List availableVMs, int numToStop)
availableVMs - A List of Integers, where the Integer is the vm id
of a vm available for stopping. This is modified upon return to
remove the vms that were stopped.numToStop - The desired number of vms to stop. Throws an exception of
this is more than the number of vms available to stop.protected Set getLostBuckets()
protected void adjustRegionSnapshotForLostKeys(Map regionSnapshot)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.