public class QueryTest 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.| Modifier and Type | Class and Description |
|---|---|
static class |
QueryTest.QueryObserverImpl |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
ADD_OPERATION |
protected static int |
COUNT_QUERY_OPERATION |
protected static int |
CREATE_INDEX_OPERATION |
protected static String |
createCallbackPrefix |
protected static int |
DESTROY_OPERATION |
protected static String |
destroyCallbackPrefix |
protected com.gemstone.gemfire.distributed.DistributedLockService |
distLockService |
protected boolean |
ignoreQueryExecTimeOutException |
protected static int |
INVALIDATE_OPERATION |
protected static String |
invalidateCallbackPrefix |
protected boolean |
isCarefulValidation |
protected boolean |
isSerialExecution |
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 |
static int |
MILLIS_TO_WAIT |
protected long |
minTaskGranularityMS |
protected long |
minTaskGranularitySec |
protected int |
numOfRegions |
protected int |
numVMs |
protected static HydraThreadLocal |
origClassLoader |
protected static boolean |
pdxReadSerialized |
protected static int |
PDXSTRING_QUERY_OPERATION |
com.gemstone.gemfire.cache.client.Pool |
pool |
protected static int |
QUERY_OPERATION |
protected int |
queryLimit |
protected static QueryTest |
queryTest |
protected RandomValues |
randomValues |
protected static int |
READ_OPERATION |
static String |
REGION_NAME |
protected static int |
REMOVE_INDEX_OPERATION |
protected static int |
UPDATE_OPERATION |
protected static String |
updateCallbackPrefix |
| Constructor and Description |
|---|
QueryTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addObject(com.gemstone.gemfire.cache.Region aRegion,
boolean logAddition) |
protected void |
createCacheFromXml(String xmlFilename)
Creates the cache based on the given xmlFile
|
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 void |
doEntryAndQueryOperations() |
protected void |
doQuery(boolean logAddition)
Executes the query over the region
|
protected com.gemstone.gemfire.cache.CacheListener |
getCacheListener()
Returns the
CacheListener that is installed on regions created
by this test. |
protected int |
getNumVMsWithListeners() |
protected Object |
getObjectToAdd(String classname)
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.
|
com.gemstone.gemfire.cache.Region |
getRandomRegionWithValueConstrains() |
protected Object |
getUpdateObject(String classname)
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_doEntryAndQueryOperations()
Performs randomly selected operations (add, invalidate, etc.) on the root
region based on the weightings in
QueryPrms#entryOperations. |
static void |
HydraTask_initialize_clientCache() |
static void |
HydraTask_initialize_xml()
Creates and initializes the singleton instance of
QueryTest in this VM. |
static void |
HydraTask_initialize()
Creates and initializes the singleton instance of
QueryTest in this VM. |
static void |
HydraTask_load()
Load the regions under test with numToLoad entries spread across all the
regions.
|
static void |
HydraTask_populateRegions()
Populate regions with maxObjects number of region entries.
|
void |
initialize_clientCache() |
void |
initialize() |
void |
initialize(String xmlFilename) |
protected void |
invalidateObject(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate) |
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 static QueryTest queryTest
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 QUERY_OPERATION
protected static final int CREATE_INDEX_OPERATION
protected static final int REMOVE_INDEX_OPERATION
protected static final int COUNT_QUERY_OPERATION
protected static final int PDXSTRING_QUERY_OPERATION
protected static boolean pdxReadSerialized
protected static HydraThreadLocal origClassLoader
protected int numOfRegions
protected boolean isSerialExecution
protected boolean isCarefulValidation
protected boolean ignoreQueryExecTimeOutException
protected int queryLimit
public static final int MILLIS_TO_WAIT
protected int numVMs
protected long minTaskGranularitySec
protected long minTaskGranularityMS
protected RandomValues randomValues
protected int maxObjects
protected com.gemstone.gemfire.distributed.DistributedLockService distLockService
public com.gemstone.gemfire.cache.client.Pool pool
protected static final String createCallbackPrefix
protected static final String updateCallbackPrefix
protected static final String invalidateCallbackPrefix
protected static final String destroyCallbackPrefix
protected static String LOCK_SERVICE_NAME
protected static String LOCK_NAME
public static final String REGION_NAME
public static void HydraTask_initialize()
QueryTest in this VM.public static void HydraTask_initialize_xml()
QueryTest in this VM.public static void HydraTask_initialize_clientCache()
public void initialize_clientCache()
public void initialize()
public void initialize(String xmlFilename)
HydraTask_initialize()public static void HydraTask_load()
public static void HydraTask_populateRegions()
public static void HydraTask_doEntryAndQueryOperations()
QueryPrms#entryOperations. The
operations will continue to be performed until the
minimum task granularity
has been reached.public com.gemstone.gemfire.cache.Region getRandomRegionWithValueConstrains()
protected void doEntryAndQueryOperations()
#HydraTask_doEntryOperationsprotected 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 doQuery(boolean logAddition)
protected Object getObjectToAdd(String classname)
name to add to a region.BaseValueHolder,
RandomValuesprotected Object getUpdateObject(String classname)
name.protected com.gemstone.gemfire.cache.CacheListener getCacheListener()
CacheListener that is installed on regions created
by this test.ETListenerprotected int getNumVMsWithListeners()
protected void createRootRegions()
Cache used in this test according to
the configuration in a RegionDefinition.protected void createCacheFromXml(String xmlFilename)
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 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 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.