public class MixedRegionViewTest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
checkEventCounters |
protected static String |
createCallbackPrefix |
protected static String |
destroyCallbackPrefix |
protected boolean |
initializeTxInfo |
protected static String |
invalidateCallbackPrefix |
protected boolean |
isProxy |
protected boolean |
isSerialExecution |
protected int |
maxKeys |
protected static String |
memberIdString |
int |
modValInitializer |
protected Integer |
myVmPid |
static int |
NO_REPLICATION_RESTRICTION |
RandomValues |
randomValues |
protected static String |
regionDestroyCallbackPrefix |
protected static String |
regionInvalidateCallbackPrefix |
protected GsRandom |
rng |
static MixedRegionViewTest |
testInstance |
protected com.gemstone.gemfire.internal.cache.TXStateInterface |
txContext |
protected boolean |
txInProgress |
protected HydraThreadLocal |
txState |
protected static String |
updateCallbackPrefix |
static int |
USE_PARTITIONED_REGION |
static int |
USE_REPLICATED_REGION |
protected boolean |
useFunctionExecution |
| Constructor and Description |
|---|
MixedRegionViewTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beginTx() |
protected void |
checkCommittedState() |
protected void |
checkEventCounters()
Check CacheListener Event Counters
|
protected void |
checkTxEventCounters()
Check TxListener Event Counters
|
protected void |
checkTxWriterCounters()
Check TxWriter Event Counters
|
protected void |
checkWriterCounters()
Check CacheWriter Event Counters
|
Operation |
createEntry(com.gemstone.gemfire.cache.Region aRegion)
Does a creates for a key.
|
void |
createPartitionedRegions() |
void |
createRegionHierarchy(String regionConfig)
Create a forest of regions based on numRootRegions,
numSubRegions, regionDepth
|
Operation |
destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Destroys an entry in aRegion.
|
static OpList |
doOperations()
Do random operations on random regions using the hydra parameter
TxPrms.operations as the list of available operations and
TxPrms.numOps as the number of operations to do.
|
static OpList |
doOperations(boolean allowGetOperations)
Do random operations on random regions using the hydra parameter
TxPrms.operations as the list of available operations and
TxPrms.numOps as the number of operations to do.
|
OpList |
doOperations(Vector operations,
int numOperationsToDo)
Do random operations on random regions.
|
OpList |
doOperations(Vector operations,
int numOperationsToDo,
boolean allowGetOperations)
Do random operations on random regions.
|
protected void |
dumpLocalKeys() |
protected Object |
executeOp(com.gemstone.gemfire.cache.Region aRegion,
String opName,
Object key,
Object value,
String callback)
Execute the specified operation with (key, value) provided
on the given region.
|
protected void |
executeTx() |
protected void |
finishTx() |
Operation |
getEntryWithNewKey(com.gemstone.gemfire.cache.Region aRegion)
Gets a value in aRegion with a the next new (never-before_used) key.
|
Operation |
getEntryWithPreviousKey(com.gemstone.gemfire.cache.Region aRegion)
Gets a value in aRegion with a random key that was previously used in the test.
|
protected KeySetResult |
getKeySet(com.gemstone.gemfire.cache.Region aRegion,
com.gemstone.gemfire.distributed.DistributedMember targetDM) |
Object |
getNewKey(com.gemstone.gemfire.cache.Region aRegion)
Gets a new (never before seen) key
|
Object |
getNewKeyForPartitionedRegion(com.gemstone.gemfire.cache.Region aRegion)
Gets a new (never before seen) key.
|
Object |
getNewValue(Object key) |
Object |
getRandomKey(com.gemstone.gemfire.cache.Region aRegion)
Get a random key from the given region.
|
Object |
getRandomKey(com.gemstone.gemfire.cache.Region aRegion,
Object excludeKey)
Get a random key from the given region, excluding the key specified
by excludeKey.
|
com.gemstone.gemfire.cache.Region |
getRandomRegion(boolean allowRootRegion)
Return a currently existing random region.
|
com.gemstone.gemfire.cache.Region |
getRandomRegion(boolean allowRootRegion,
int restriction)
Return a currently existing random region.
|
com.gemstone.gemfire.cache.Region |
getRandomRegion(boolean allowRootRegion,
com.gemstone.gemfire.cache.Region excludeRegion,
int restriction)
Return a currently existing random region.
|
static long |
getRoundRobinNumber()
Return the current roundRobin number.
|
Set |
getSubregions(com.gemstone.gemfire.cache.Region aRegion,
boolean recursive)
Return a Set of subregions of the given region, while handling
regionDestroyedExceptions.
|
static MixedRegionViewTest |
getTestInstance() |
Object |
getValueInVM(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Call getValueInVM on the given region and key using suspend and resume.
|
Operation |
getWithExistingKey(com.gemstone.gemfire.cache.Region aRegion)
Gets a value in aRegion with a key existing in aRegion.
|
static void |
HydraTask_checkCommittedState() |
static void |
HydraTask_createPartitionedRegions()
Create the cache and Partitioned Regions.
|
static void |
HydraTask_createReplicatedRegions()
Hydra task to create a forest of replicated regions.
|
static void |
HydraTask_dumpLocalKeys()
Debug method to see what keys are on each VM at start of test
|
static void |
HydraTask_executeTx() |
static void |
HydraTask_populateRegions() |
void |
incrementEventCounters(OpList txOpList,
int counterType) |
void |
initialize() |
void |
initialize(String regionConfig) |
protected void |
initializeKeySet(boolean useLocalKeySet)
Initialize remote keySet.
|
static boolean |
inTxThreadWithTxInProgress() |
static boolean |
inTxVm() |
Operation |
invalEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Invalidates an entry in aRegion.
|
boolean |
isHierReplicated(com.gemstone.gemfire.cache.Region aRegion)
Return true if the region or any of its subregions is replicated,
return false otherwise.
|
static void |
logExecutionNumber()
Log the number of tasks that have been executed in this test.
|
static boolean |
logRoundRobinNumber()
Log the "round" number for this test.
|
protected void |
populateRegions() |
Operation |
putEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
BaseValueHolder value,
String opName)
Puts a new key/value in the given region.
|
protected void |
registerFunctions() |
Operation |
updateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Updates an existing entry in aRegion.
|
protected void |
updateKeySet(Operation op)
Update (per region) keySet
Region specific keySets are maintained through each invocation
of doOperations().
|
protected void |
validateAllStates(boolean isTxVisible) |
protected void |
validateCombinedOpsAfterCommit() |
protected void |
validateCombinedOpsAfterRollback() |
protected void |
validateCommittedState(boolean txCommitted) |
protected boolean |
validateNonTxOps() |
protected void |
validateState(OpList opList,
boolean isVisible) |
protected void |
validateState(OpList opList,
boolean isVisible,
String txAction) |
protected boolean |
validateTxOps(boolean isTxVisible) |
protected boolean |
validateTxOps(boolean isTxVisible,
String txAction) |
public static MixedRegionViewTest testInstance
protected GsRandom rng
protected boolean txInProgress
protected boolean isProxy
protected Integer myVmPid
protected boolean initializeTxInfo
protected boolean checkEventCounters
protected boolean useFunctionExecution
protected com.gemstone.gemfire.internal.cache.TXStateInterface txContext
public RandomValues randomValues
protected int maxKeys
public int modValInitializer
protected boolean isSerialExecution
protected HydraThreadLocal txState
public static final int NO_REPLICATION_RESTRICTION
public static final int USE_REPLICATED_REGION
public static final int USE_PARTITIONED_REGION
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
protected static final String memberIdString
public void initialize()
public void initialize(String regionConfig)
public static MixedRegionViewTest getTestInstance()
public static void HydraTask_createReplicatedRegions()
public void createRegionHierarchy(String regionConfig)
public static void HydraTask_createPartitionedRegions()
public void createPartitionedRegions()
public static void HydraTask_populateRegions()
protected void populateRegions()
public static void HydraTask_dumpLocalKeys()
protected void dumpLocalKeys()
protected void registerFunctions()
public static void HydraTask_executeTx()
protected void executeTx()
protected void beginTx()
protected void finishTx()
protected void validateCommittedState(boolean txCommitted)
protected void validateCombinedOpsAfterCommit()
protected void validateCombinedOpsAfterRollback()
public static void HydraTask_checkCommittedState()
protected void checkCommittedState()
protected void validateAllStates(boolean isTxVisible)
protected boolean validateNonTxOps()
protected boolean validateTxOps(boolean isTxVisible)
protected boolean validateTxOps(boolean isTxVisible,
String txAction)
protected void validateState(OpList opList, boolean isVisible)
protected void checkWriterCounters()
protected void checkTxWriterCounters()
protected void checkEventCounters()
protected void checkTxEventCounters()
public void incrementEventCounters(OpList txOpList, int counterType)
public static void logExecutionNumber()
public static boolean logRoundRobinNumber()
public static long getRoundRobinNumber()
public com.gemstone.gemfire.cache.Region getRandomRegion(boolean allowRootRegion)
allowRootRegion - true if this call can return the root region, false otherwise.public com.gemstone.gemfire.cache.Region getRandomRegion(boolean allowRootRegion,
int restriction)
allowRootRegion - true if this call can return the root region, false otherwise.restriction - (forces selection of Partitioned vs. Replicated Regions)public com.gemstone.gemfire.cache.Region getRandomRegion(boolean allowRootRegion,
com.gemstone.gemfire.cache.Region excludeRegion,
int restriction)
allowRootRegion - true if this call can return the root region, false otherwise.excludeRegion - Return a region other than this region, or null if none to exclude.restriction - Restriction on what region can be returned, for example
NO_REPLICATION_RESTRICTION, NO_REPLICATIONpublic static OpList doOperations()
public static OpList doOperations(boolean allowGetOperations)
allowGetOperations - - to prevent proxy clients from attempting
gets (since they have no storage this always
invokes the loader and oldValue is always
reported as null).public OpList doOperations(Vector operations, int numOperationsToDo)
operations - - a Vector of operations to choose from.numOperationsToDo - - the number of operations to execute.public OpList doOperations(Vector operations, int numOperationsToDo, boolean allowGetOperations)
operations - - a Vector of operations to choose from.numOperationsToDo - - the number of operations to execute.allowGetOperations - - if false, replace entry-get ops with entry-createpublic Operation createEntry(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to create the new key in.public Operation updateEntry(com.gemstone.gemfire.cache.Region aRegion, Object key)
aRegion - The region to modify a key in.key - The key to modify.public Operation destroyEntry(com.gemstone.gemfire.cache.Region aRegion, Object key)
aRegion - The region to destroy the entry in.key - The key to destroy.public Operation invalEntry(com.gemstone.gemfire.cache.Region aRegion, Object key)
aRegion - The region to invalidate the entry in.key - The key to invalidate.public Operation getWithExistingKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to get from.public Operation getEntryWithPreviousKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to get from.public Object getNewKey(com.gemstone.gemfire.cache.Region aRegion)
public Object getNewKeyForPartitionedRegion(com.gemstone.gemfire.cache.Region aRegion)
public Operation getEntryWithNewKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to get from.public Operation putEntry(com.gemstone.gemfire.cache.Region aRegion, Object key, BaseValueHolder value, String opName)
aRegion - The region to create the new key in.key - The key to use for the put.value - The value to put.opName - The operation to use for the returned Operation instance.public Object getRandomKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - - The region to get the key from.public Object getRandomKey(com.gemstone.gemfire.cache.Region aRegion, Object excludeKey)
aRegion - - The region to get the key from.excludeKey - - The region to get the key from.public static boolean inTxThreadWithTxInProgress()
public static boolean inTxVm()
public boolean isHierReplicated(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region parent to test for replication.public Set getSubregions(com.gemstone.gemfire.cache.Region aRegion, boolean recursive)
aRegion - - The region to get subregions of.recursive - - If true, return all subregions, otherwise
only aRegion's subregions.public Object getValueInVM(com.gemstone.gemfire.cache.Region aRegion, Object key)
aRegion - - The region to use for the call.key - - The key to use for the call.protected void initializeKeySet(boolean useLocalKeySet)
protected KeySetResult getKeySet(com.gemstone.gemfire.cache.Region aRegion, com.gemstone.gemfire.distributed.DistributedMember targetDM)
protected void updateKeySet(Operation op)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.