public class ProxyEventTest extends Object
EventBB and EventCountersBB to keep track of what
has happened and to validate that what has happened is expected.
It requires that the regions that it tests be distributed and
mirrored.EventPrms| Modifier and Type | Field and Description |
|---|---|
protected static int |
ADD_OPERATION |
protected static int |
CLEAR_OPERATION |
protected String |
clientName |
protected static String |
createCallbackPrefix |
protected static int |
DESTROY_OPERATION |
protected static String |
destroyCallbackPrefix |
protected com.gemstone.gemfire.distributed.DistributedLockService |
distLockService |
protected static ProxyEventTest |
eventTest |
protected static int |
INVALIDATE_OPERATION |
protected static String |
invalidateCallbackPrefix |
protected boolean |
isCarefulValidation |
protected boolean |
isMirrored |
protected boolean |
isSerialExecution |
protected boolean |
isSerialRR |
protected static int |
LOCAL_DESTROY_OPERATION |
protected static int |
LOCAL_INVALIDATE_OPERATION |
protected static String |
LOCK_NAME |
protected static String |
LOCK_SERVICE_NAME |
protected int |
maxObjects |
protected int |
maxRegions |
protected static String |
memberIdString |
static int |
MILLIS_TO_WAIT |
protected long |
minTaskGranularityMS |
protected long |
minTaskGranularitySec |
protected static int |
NO_OPERATION |
protected int |
numVMs |
protected RandomValues |
randomValues |
protected static int |
READ_OPERATION |
protected static int |
REGION_CLOSE_OPERATION |
protected static String |
regionDestroyCallbackPrefix |
protected static String |
regionInvalidateCallbackPrefix |
protected String |
regionName |
protected com.gemstone.gemfire.cache.Region |
shadow |
String |
shadowRegionName |
protected static int |
UPDATE_OPERATION |
protected static String |
updateCallbackPrefix |
protected boolean |
useEvictionController |
protected boolean |
useTransactions |
| Constructor and Description |
|---|
ProxyEventTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addObject(com.gemstone.gemfire.cache.Region aRegion,
boolean logAddition) |
protected void |
addRegion()
Creates a new subregion of a randomly-selected parent region
(which could be the root region).
|
protected void |
addRegion(com.gemstone.gemfire.cache.Region parentRegion,
String regionName) |
protected void |
addToRegion()
Random choose a region and add an object to it for the duration
of minTaskGranularity hydra param
|
protected void |
checkEventCounters()
Must overridden in a subclass
|
protected int |
clearRegion() |
protected int |
clearRegion(com.gemstone.gemfire.cache.Region aRegion)
clears a specified region
|
protected int |
closeRegion()
Close a random region.
|
protected int |
closeRegion(com.gemstone.gemfire.cache.Region aRegion) |
protected void |
createRootRegions()
Creates the root region in the
Cache used in this test
according to the configuration in a RegionDefinition. |
protected void |
destroyObject(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalDestroy) |
protected int |
destroyRegion(boolean isLocalDestroy)
Destroys a random region.
|
protected int |
destroyRegion(boolean isLocalDestroy,
com.gemstone.gemfire.cache.Region aRegion) |
protected void |
doEntryOperations(com.gemstone.gemfire.cache.Region aRegion) |
protected void |
doRegionOperations() |
protected void |
executeRegionOp() |
protected int |
faultInNewRegions()
Find regions created during the test (in any cache) using the
EventBB and create those regions in this cache also. |
protected Object[] |
faultInRegion(com.gemstone.gemfire.cache.Region parentRegion,
String newRegionName,
com.gemstone.gemfire.cache.RegionAttributes attr)
Create a region in this cache, which was previously created in another cache.
|
protected long |
getNumNonRootRegions()
Return the current number of non-root regions.
|
protected int |
getNumVMsWithListeners() |
protected Object |
getObjectToAdd(String name)
Creates a new object with the given
name to add to a
region. |
protected int |
getOperation(Long whichPrm,
boolean disallowLocalEntryOps)
Return a random operation from the hydra parameter specified by whichPrm.
|
protected com.gemstone.gemfire.cache.Region |
getRandomRegion(boolean allowRootRegion)
Return a currently existing random region.
|
protected Object |
getUpdateObject(String name)
Returns the "updated" value of the object with the given
name. |
protected void |
handleRegionDestroyedException(com.gemstone.gemfire.cache.Region aRegion,
com.gemstone.gemfire.cache.RegionDestroyedException anException)
Called when the test gets a RegionDestroyedException.
|
static void |
HydraTask_addToRegion()
Adds new entries to randomly selected regions until the
minimum task
granularity has been reached.
|
static void |
HydraTask_doEntryOperations()
Performs randomly selected operations (add, invalidate, etc.) on
the root region based on the weightings in
EventPrms.entryOperations. |
static void |
HydraTask_doRegionOperations()
Performs randomly selected operations (create new region,
invalidate an entire randomly selected region, etc.) based on the
weightings in
EventPrms.regionOperations.The operations
will continue to be performed until the minimum task granularity
has been reached. |
static void |
HydraTask_endTask() |
static void |
HydraTask_executeRegionOp()
For use in SerialRoundRobin (Region) Tests
Duplicates the single Region Operation performed in the first
member of the RoundRobin; validates counters appropriately
|
static void |
HydraTask_initialize()
Creates and initializes the singleton
instance of
ProxyEventTest in this VM. |
static void |
HydraTask_iterate() |
static void |
HydraTask_printBB() |
protected void |
initialize() |
protected void |
invalidateObject(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate) |
protected int |
invalidateRegion(boolean isLocalInvalidate)
Invalidate a random region.
|
protected int |
invalidateRegion(boolean isLocalInvalidate,
com.gemstone.gemfire.cache.Region aRegion)
Invalidate a specific region
|
protected Object[] |
iterateRegion(com.gemstone.gemfire.cache.Region aRegion,
boolean allowZeroKeys,
boolean allowZeroNonNullValues)
Used for end task validation, iterate the keys/values in the given region,
checking that the key/value match according to the test strategy.
|
protected static void |
logExecutionNumber() |
protected void |
readObject(com.gemstone.gemfire.cache.Region aRegion)
Fetches (reads) the value of a randomly selected entry in the
given region.
|
protected void |
updateObject(com.gemstone.gemfire.cache.Region aRegion)
Updates the "first" entry in a given region
|
protected void |
updateObject(com.gemstone.gemfire.cache.Region aRegion,
Object name)
Updates the entry with the given key (
name) in the
given region. |
protected void |
verifyObjectDestroyed(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Verify that the given key in the given region is destroyed (has no key/value).
|
protected void |
verifyObjectInvalidated(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Verify that the given key in the given region is invalid (has a null value).
|
protected void |
writeMyRegionNames() |
protected void |
writeMyRegionNames(com.gemstone.gemfire.cache.Region excludeRegion) |
protected static ProxyEventTest eventTest
protected static final int ADD_OPERATION
protected static final int UPDATE_OPERATION
protected static final int INVALIDATE_OPERATION
protected static final int DESTROY_OPERATION
protected static final int READ_OPERATION
protected static final int LOCAL_INVALIDATE_OPERATION
protected static final int LOCAL_DESTROY_OPERATION
protected static final int REGION_CLOSE_OPERATION
protected static final int CLEAR_OPERATION
protected static final int NO_OPERATION
protected boolean useTransactions
protected boolean isSerialExecution
protected boolean isCarefulValidation
public static final int MILLIS_TO_WAIT
protected int numVMs
protected long minTaskGranularitySec
protected long minTaskGranularityMS
protected RandomValues randomValues
protected boolean useEvictionController
protected int maxObjects
protected int maxRegions
protected com.gemstone.gemfire.distributed.DistributedLockService distLockService
protected boolean isMirrored
protected String clientName
protected com.gemstone.gemfire.cache.Region shadow
protected String regionName
public String shadowRegionName
protected boolean isSerialRR
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
protected static String LOCK_SERVICE_NAME
protected static String LOCK_NAME
public static void HydraTask_initialize()
ProxyEventTest in this VM.protected void initialize()
HydraTask_initialize()public static void HydraTask_doEntryOperations()
EventPrms.entryOperations. The operations will continue to be
performed until the minimum task granularity
has been reached.public static void HydraTask_doRegionOperations()
EventPrms.regionOperations.The operations
will continue to be performed until the minimum task granularity
has been reached.public static void HydraTask_addToRegion()
protected void doEntryOperations(com.gemstone.gemfire.cache.Region aRegion)
HydraTask_doEntryOperations()protected void addObject(com.gemstone.gemfire.cache.Region aRegion,
boolean logAddition)
protected void invalidateObject(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate)
protected void destroyObject(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalDestroy)
protected void updateObject(com.gemstone.gemfire.cache.Region aRegion)
protected void updateObject(com.gemstone.gemfire.cache.Region aRegion,
Object name)
name) in the
given region.protected void readObject(com.gemstone.gemfire.cache.Region aRegion)
protected void doRegionOperations()
HydraTask_doRegionOperations()public static void HydraTask_executeRegionOp()
protected void executeRegionOp()
HydraTask_executeRegionOp()protected void addRegion()
protected void addRegion(com.gemstone.gemfire.cache.Region parentRegion,
String regionName)
protected int invalidateRegion(boolean isLocalInvalidate)
isLocalInvalidate - true if the invalidate should be a local invalidate, false otherwise.protected int invalidateRegion(boolean isLocalInvalidate,
com.gemstone.gemfire.cache.Region aRegion)
isLocalInvalidate - true if the invalidate should be a local invalidate, false otherwise.aRegion - - target region (for invalidation)protected int closeRegion()
protected int closeRegion(com.gemstone.gemfire.cache.Region aRegion)
protected int destroyRegion(boolean isLocalDestroy)
isLocalDestroy - true if the destroy should be a local destroy, false otherwise.protected int destroyRegion(boolean isLocalDestroy,
com.gemstone.gemfire.cache.Region aRegion)
protected int clearRegion()
protected int clearRegion(com.gemstone.gemfire.cache.Region aRegion)
aRegion - - target region (to clear)protected void addToRegion()
protected int faultInNewRegions()
EventBB and create those regions in this cache also. By
doing this, a cache which did not originally create a region will
be able to invalidate or destroy it.protected Object[] faultInRegion(com.gemstone.gemfire.cache.Region parentRegion, String newRegionName, com.gemstone.gemfire.cache.RegionAttributes attr)
parentRegion - The parent region of the region to create.newRegionName - The new of the new subregion of parentRegion.attr - The region attributes for the new region.protected void checkEventCounters()
protected Object getObjectToAdd(String name)
name to add to a
region.BaseValueHolder,
RandomValuesprotected Object getUpdateObject(String name)
name.protected int getNumVMsWithListeners()
protected void createRootRegions()
Cache used in this test
according to the configuration in a RegionDefinition.protected Object[] iterateRegion(com.gemstone.gemfire.cache.Region aRegion, boolean allowZeroKeys, boolean allowZeroNonNullValues)
aRegion - - the region to iterate.allowZeroKeys - - If the number of keys in the region is 0, then allow it
if this is true, otherwise log an error to the return string.allowZeroNonNullValues - - If the number of non-null values in the region
is 0, then allow it if this is true, otherwise log an error to the return
string.protected int getOperation(Long whichPrm, boolean disallowLocalEntryOps)
whichPrm - - the hydra parameter that is a list of operationsdisallowLocalEntryOps - - if true, then do not return localInvalidate
or localDestroy. This is used for regions that are mirrored, since
localInvalidate and localDestroy are disallowed for mirrored regions.protected static void logExecutionNumber()
protected void writeMyRegionNames()
protected void writeMyRegionNames(com.gemstone.gemfire.cache.Region excludeRegion)
protected com.gemstone.gemfire.cache.Region getRandomRegion(boolean allowRootRegion)
allowRootRegion - true if this call can return the root region, false otherwise.protected void handleRegionDestroyedException(com.gemstone.gemfire.cache.Region aRegion,
com.gemstone.gemfire.cache.RegionDestroyedException anException)
aRegion - - the region that supposedly was destroyed and triggered the
RegionDestroyedExceptionanException - - the exception that was thrown.protected long getNumNonRootRegions()
protected void verifyObjectInvalidated(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region containing keykey - The key that should have a null valueprotected void verifyObjectDestroyed(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region contains the destroyed keykey - The destroyed keyCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.