public class RecovDelayTest
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected com.gemstone.gemfire.cache.Region |
aRegion |
protected static java.lang.String |
CONCURRENT_STARTUP |
protected java.util.Map |
hostMap |
protected int |
IMMEDIATE |
protected java.util.List |
liveVMs |
protected java.util.Set |
masterBucketIdSet |
protected java.util.List |
masterBucketInfoList |
protected java.util.Map |
masterPrMap |
protected int |
NEVER |
protected int |
numDataStoreVMs |
protected ParRegTest |
parRegTestInstance |
protected int |
recoveryDelay |
protected int |
redundantCopies |
protected static java.lang.String |
redundantCopiesKey |
protected static java.lang.String |
SERIAL_STARTUP |
protected static java.lang.String |
START_WITH_ALL |
protected java.lang.String |
startStrategy |
protected int |
startupRecoveryDelay |
protected boolean |
startupRecoveryRace |
protected java.util.List |
stoppedVMs |
protected java.lang.String |
stopStrategy |
static RecovDelayTest |
testInstance |
protected int |
totalBucketCopies |
protected int |
totalNumVMsToStop |
protected boolean |
uniqueHostTest |
protected static java.lang.String |
vmIDStr |
protected java.util.List |
vmsToStart |
| Constructor and Description |
|---|
RecovDelayTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustRegionSnapshotForLostKeys(java.util.Map regionSnapshot) |
protected void |
checkForBalance(java.util.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 java.util.Set |
getBucketIds(java.util.List aBucketList) |
protected java.util.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(java.lang.String regDescriptName)
Create a region with the given region description name.
|
protected void |
load()
Load the region with RecovDelayPrms.initialNumKeys.
|
protected java.util.List |
stopVMs(java.util.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(java.util.List previousLiveVMs,
java.util.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(java.util.List vmsExpectingRecovery,
int numRecovPerVM,
boolean isStartupRecovery)
Validate that recovery occurs now.
|
protected void |
validateRecoveryWithDelay(int delayMillis,
java.util.List vmsExpectingRecovery,
int numRecovPerVM,
boolean isStartupRecovery)
Validate that recovery occurs after the given delay.
|
protected void |
verifyBucketsInVMs(java.util.List emptyVMs,
java.util.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 java.lang.String vmIDStr
protected static final java.lang.String redundantCopiesKey
protected static final java.lang.String START_WITH_ALL
protected static final java.lang.String SERIAL_STARTUP
protected static final java.lang.String CONCURRENT_STARTUP
protected com.gemstone.gemfire.cache.Region aRegion
protected java.lang.String startStrategy
protected java.lang.String stopStrategy
protected int recoveryDelay
protected int startupRecoveryDelay
protected int redundantCopies
protected int totalBucketCopies
protected int numDataStoreVMs
protected int totalNumVMsToStop
protected java.util.List stoppedVMs
protected java.util.List vmsToStart
protected java.util.List liveVMs
protected ParRegTest parRegTestInstance
protected java.util.List masterBucketInfoList
protected java.util.Map masterPrMap
protected java.util.Set masterBucketIdSet
protected boolean uniqueHostTest
protected java.util.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(java.lang.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(java.util.List previousLiveVMs,
java.util.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(java.util.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,
java.util.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(java.util.Map prMap)
prMap - The return from PrState.getPrMap(Region); this
the the PR picture to check.protected void waitForNever()
protected void verifyBucketsInVMs(java.util.List emptyVMs,
java.util.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 java.util.List stopVMs(java.util.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 java.util.Set getBucketIds(java.util.List aBucketList)
protected java.util.Set getLostBuckets()
protected void adjustRegionSnapshotForLostKeys(java.util.Map regionSnapshot)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.