public class RandInterestPolicyTest extends Object
| Constructor and Description |
|---|
RandInterestPolicyTest() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
addEntry(com.gemstone.gemfire.cache.Region aRegion)
Add a new entry to the given region.
|
protected void |
checkForLastIteration()
Check if we have run for the desired length of time.
|
protected static void |
closeAndOpenRegion()
Close the region to prepare for the next registerInterest.
|
protected void |
concVerify() |
protected void |
createRegion()
Create the local scope region for bridge clients.
|
protected void |
destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalDestroy)
Destroy an entry in the given region.
|
protected void |
doConcOpsAndVerify(boolean registerWithEmptyRegion)
Do random operations and verification for concurrent tests.
|
protected void |
doEntryOperations(com.gemstone.gemfire.cache.Region aRegion)
Do random entry operations on the given region ending either with
minTaskGranularityMS or numOpsPerTask.
|
protected void |
doRROpsAndVerify()
Do random operations and verification for serial round robin test.
|
protected Object |
getExistingKey(com.gemstone.gemfire.cache.Region aRegion)
Return a random key currently in the given region.
|
protected void |
getKey(com.gemstone.gemfire.cache.Region aRegion)
Get an existing key in the given region if one is available,
otherwise get a new key.
|
protected Object |
getNewKey()
Return a new key
|
protected void |
getNewKey(com.gemstone.gemfire.cache.Region aRegion)
Get a new key int the given region.
|
protected int |
getOperation(Long whichPrm)
Get a random operation using the given hydra parameter.
|
protected Object |
getRecentKey(com.gemstone.gemfire.cache.Region aRegion,
int recentHistory)
Return a random recently used key.
|
protected BaseValueHolder |
getUpdateObject(com.gemstone.gemfire.cache.Region aRegion,
String key)
Return an object to be used to update the given key.
|
protected BaseValueHolder |
getValueForKey(Object key)
Return a value for the given key
|
static void |
HydraTask_doConcOpsAndVerify()
Hydra task method for concurrent tests with verification.
|
static void |
HydraTask_doEntryOps()
Hydra task method to do random entry operations.
|
static void |
HydraTask_doRROpsAndVerify()
Hydra task method for serial round robin tests.
|
static void |
HydraTask_initBridgeServer()
Initializes the test region in the cache server VM
|
static void |
HydraTask_initialize()
Creates and initializes the singleton instance of RandInterestPolicyTest
in this VM.
|
protected void |
initializeInstance()
Initialize this test instance
|
protected void |
invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate)
Invalidate an entry in the given region.
|
protected static void |
logExecutionNumber()
Log the execution number of this serial task.
|
protected Object |
putIfAbsent(com.gemstone.gemfire.cache.Region aRegion)
Add a new entry to the given region via putIfAbsent
|
protected static void |
registerInterest()
Register interest with ALL_KEYS, and policy KEYS_VALUES
|
protected void |
remove(com.gemstone.gemfire.cache.Region aRegion)
Remove an entry from the given region.
|
protected void |
replace(com.gemstone.gemfire.cache.Region aRegion)
Replace an existing entry in the given region.
|
protected void |
updateEntry(com.gemstone.gemfire.cache.Region aRegion)
Update an existing entry in the given region.
|
protected static void |
verifyContainsKey(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean expected)
Verify containsKey for the given region and key.
|
protected static void |
verifyContainsValueForKey(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean expected)
Verify containsValueForKey for the given region and key.
|
protected void |
verifyFromSnapshot()
Verify this thread's view of the keys and values in the region
by reading the region snapshot and destroyed keys from the blackboad.
|
protected static void |
verifyMyValue(com.gemstone.gemfire.cache.Region aRegion,
Object key,
Object expectedValue,
Object valueToCheck,
int compareStrategy)
Verify that the given object is an instance of ValueHolder
with expectedValue as the myValue field.
|
protected static void |
verifySize(com.gemstone.gemfire.cache.Region aRegion,
int expectedSize)
Verify that the size of the given region is expectedSize.
|
protected static RandInterestPolicyTest testInstance
protected static final int ENTRY_ADD_OPERATION
protected static final int ENTRY_DESTROY_OPERATION
protected static final int ENTRY_INVALIDATE_OPERATION
protected static final int ENTRY_LOCAL_DESTROY_OPERATION
protected static final int ENTRY_LOCAL_INVALIDATE_OPERATION
protected static final int ENTRY_UPDATE_OPERATION
protected static final int ENTRY_GET_OPERATION
protected static final int ENTRY_GET_NEW_OPERATION
protected static final int PUT_IF_ABSENT_OPERATION
protected static final int REMOVE_OPERATION
protected static final int REPLACE_OPERATION
protected static final String REGION_NAME
protected long minTaskGranularitySec
protected long minTaskGranularityMS
protected int numOpsPerTask
protected boolean isSerialExecution
protected int totalNumThreadsInTest
protected RandomValues randomValues
protected com.gemstone.gemfire.cache.Region aRegion
protected int upperThreshold
protected int lowerThreshold
protected int concurrentLeaderTid
protected int secondsToRun
protected volatile long taskStartTime
protected Map regionSnapshot
protected Set destroyedKeys
protected boolean useOwnKeys
protected static volatile MethodCoordinator registerInterestCoordinator
public HydraThreadLocal ownKeysIndex
protected static final String getCallbackPrefix
protected static final String createCallbackPrefix
protected static final String updateCallbackPrefix
protected static final String invalidateCallbackPrefix
protected static final String destroyCallbackPrefix
protected static final String regionInvalidateCallbackPrefix
protected static final String regionDestroyCallbackPrefix
public static int EQUAL
public static int EQUIVALENT
public static void HydraTask_initialize()
public static void HydraTask_initBridgeServer()
protected void initializeInstance()
protected void createRegion()
public static void HydraTask_doRROpsAndVerify()
public static void HydraTask_doConcOpsAndVerify()
public static void HydraTask_doEntryOps()
protected void doRROpsAndVerify()
protected void doConcOpsAndVerify(boolean registerWithEmptyRegion)
protected void doEntryOperations(com.gemstone.gemfire.cache.Region aRegion)
protected Object addEntry(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for adding a new entry.protected void invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate)
aRegion - The region to use for invalidating an entry.isLocalInvalidate - True if the invalidate should be local, false otherwise.protected void destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalDestroy)
aRegion - The region to use for destroying an entry.isLocalDestroy - True if the destroy should be local, false otherwise.protected Object putIfAbsent(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for adding a new entry.protected void replace(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for updating an entry.protected void remove(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for removing an entry.protected void updateEntry(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for updating an entry.protected void getKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for getting an entry.protected void getNewKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for getting an entry.protected void checkForLastIteration()
protected BaseValueHolder getValueForKey(Object key)
protected Object getNewKey()
protected Object getRecentKey(com.gemstone.gemfire.cache.Region aRegion, int recentHistory)
aRegion - The region to use for getting a recently used key.recentHistory - The number of most recently used keys to consider
for returning.protected BaseValueHolder getUpdateObject(com.gemstone.gemfire.cache.Region aRegion, String key)
aRegion - The region which possible contains key.key - The key to get a new value for.protected static void logExecutionNumber()
protected int getOperation(Long whichPrm)
whichPrm - A hydra parameter which specifies random operations.protected void verifyFromSnapshot()
protected void concVerify()
protected static void verifySize(com.gemstone.gemfire.cache.Region aRegion,
int expectedSize)
aRegion - The region to verify.expectedSize - The expected size of aRegion.TestException - if size() has the wrong valueprotected Object getExistingKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for getting an existing key.protected static void verifyContainsKey(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean expected)
aRegion - The region to verify.key - The key in aRegion to verify.expected - The expected value of containsKey()TestException - if containsKey() has the wrong valueprotected static void verifyContainsValueForKey(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean expected)
aRegion - The region to verify.key - The key in aRegion to verify.expected - The expected value of containsKey()TestException - if containsValueforKey() has the wrong valueprotected static void verifyMyValue(com.gemstone.gemfire.cache.Region aRegion,
Object key,
Object expectedValue,
Object valueToCheck,
int compareStrategy)
aRegion - The region to verify.key - The key in aRegion to verify.expectedValue - The expected myValue field of a ValueHolder in aRegion, or null
if the expected value should be null.valuetoCheck - This is expected to be a ValueHolder, whose myValue field compares
to expectedValue, according to comparStrategycompareStrategy - Whether the compare is equals or equivalent (for ValueHolders)TestException - if the result of a get on key does not have the expected value.protected static void registerInterest()
protected static void closeAndOpenRegion()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.