public class DeltaTest extends Object
| Constructor and Description |
|---|
DeltaTest() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
addEntry(com.gemstone.gemfire.cache.Region aReg)
Add a new entry to the given region.
|
protected String |
addNewValue()
Add a new entry for eviction tests
|
protected void |
badDeltaController(int testCase)
Test the given bad delta test case.
|
protected void |
checkEviction()
Check eviction in this vm for a particular key (the last operation).
|
protected static void |
checkForError()
Check for any errors written to the bb
|
protected void |
checkForLastIteration()
Check if we have run for the desired length of time.
|
protected long |
checkMemLRULevelForPR()
Iterates over all the entries hosted in this vm and calculates their bytes.
|
protected void |
checkOverageHistory()
This is called from a close task to allow the test to hit bug 41952
and report its occurrence in a close task.
|
protected void |
clear()
Clear variables that save up information for validation.
|
protected void |
concVerify()
Create a region snapshot from one vm's point of view, while any other
threads in this or the same the vm also executing this method will
compare to that snapshot.
|
protected void |
destroyEntry(com.gemstone.gemfire.cache.Region aReg,
boolean isLocalDestroy)
Destroy an entry in the given region.
|
protected void |
doConcOpsAndVerify()
Do random operations and verification for concurrent tests.
|
protected void |
doEntryOperations(com.gemstone.gemfire.cache.Region aReg)
Do random entry operations on the given region ending either with
minTaskGranularityMS or numOpsPerTask.
|
protected void |
doEvictionTestOps()
Do operations for eviction tests
|
protected void |
doRROpsAndVerify()
Do random operations and verification for serial round robin test.
|
void |
doSerialRREvictionTest()
Serial test for eviction with careful validation
|
protected void |
evictionTestLoad(com.gemstone.gemfire.cache.Region aReg)
Load the region with N entries, specified by DeltaPropagationPrms.upperThreshold.
|
static Object |
getExistingKey(com.gemstone.gemfire.cache.Region aRegion,
boolean uniqueKeys,
int numThreads)
Return a random key currently in the given region.
|
protected void |
getKey(com.gemstone.gemfire.cache.Region aReg)
Get an existing key in the given region if one is available,
otherwise get a new key.
|
protected Object |
getKeyForBadDeltaTest()
For bad delta tests:
Get a key that will be distributed for an update.
|
protected Object |
getNewKey()
Return a new key, never before used in the test.
|
protected void |
getNewKey(com.gemstone.gemfire.cache.Region aReg)
Get a new key int the given region.
|
protected int |
getOperation(Long whichPrm)
Get a random operation using the given hydra parameter.
|
protected void |
HAController()
While other threads are doing ops, stop or close the region of servers
(not clients), reinstate the servers/regions, pause and verify.
|
protected void |
HADoEntryOps()
Do entry ops and handle disconnects or cache closes.
|
protected void |
handleBadDeltaException(Class expected,
Throwable got,
boolean expectedIsFromRemoteVM)
Look for expected exception returned from remote vm.
|
protected void |
handleBadDeltaSuccessfulUpdate(int badDeltaTestCase,
Class expectedExceptionClass,
Object key,
BadDeltaObject value)
Handle the case where a bad delta was invoked, but the delta update (the put)
succeeded.
|
protected void |
handleException(Exception anExcept)
Handle an exception thrown by doing general operations during HA.
|
static void |
HydraTask_badDeltaController()
Hydra task method for serial tests with bad delta implementations.
|
static void |
HydraTask_checkMemLRULevelForPR()
Hydra task method to check the memLRU levels in a vm.
|
static void |
HydraTask_checkOverageHistory()
Hydra task method to check the overages found because of
bug 41952.
|
static void |
HydraTask_doConcOps()
Hydra task method for concurrent tests with verification.
|
static void |
HydraTask_doConcOpsAndVerify()
Hydra task method for concurrent tests with verification.
|
static void |
HydraTask_doConcOpsWithMultiRegions()
Hydra task method for concurrent tests with verification.
|
static void |
HydraTask_doMixedTest() |
static void |
HydraTask_doRROpsAndVerify()
Hydra task method for serial round robin tests.
|
static void |
HydraTask_doSerialRREvictionTest()
Hydra task method for eviction tests with delta.
|
static void |
HydraTask_evictionTestLoad()
Hydra task method to load the region with N entries, specified by
DeltaPropagationPrms.upperThreshold.
|
static void |
HydraTask_HAController()
Hydra task method to control VMs going down/up one at a time.
|
static void |
HydraTask_HADoEntryOps()
Hydra task method to do random entry operations.
|
static void |
HydraTask_initializeBridgeServer()
Creates and initializes a bridge server.
|
static void |
HydraTask_initializeClient()
Creates and initializes the singleton instance of DeltaTest in a client.
|
static void |
HydraTask_initMultiRegions()
Create several root regions with various data policies.
|
static void |
HydraTask_initMultiRegionsForClients()
Create several root regions for clients in a bridge configuration.
|
static void |
HydraTask_initRedundantCopies()
Write the number of redundant copies for the pr to the blackboard
by using the hydra param DeltaPropagationPrms.redundantCopies, which can be:
"zero" - Write 0 to the blackboard.
|
static void |
HydraTask_loadBadDeltaToUpperThreshold()
Hydra task method to load the region with N entries, specified by
DeltaPropagationPrms.upperThreshold.
|
static void |
HydraTask_loadMultiRegToUpperThreshold()
Hydra task method to load the regions with N entries, specified by
DeltaPropagationPrms.upperThreshold.
|
static void |
HydraTask_loadToUpperThreshold()
Hydra task method to load the region with N entries, specified by
DeltaPropagationPrms.upperThreshold.
|
static void |
HydraTask_recordLoadToBB()
Hydra task method to follow HydraTask_loadToUpperThreshold to
get the current state of the region recorded to the BB for
serial tests.
|
static void |
HydraTask_verifyNoDeltaCalls()
Verify that no delta calls have occurred
|
void |
initializeInstance()
Initialize instance fields of this test class
|
com.gemstone.gemfire.cache.Region |
initializeRegion(String regDescriptName)
Create a region with the given region description name.
|
protected void |
invalidateEntry(com.gemstone.gemfire.cache.Region aReg,
boolean isLocalInvalidate)
Invalidate an entry in the given region.
|
protected boolean |
isBadDeltaWarningCase(int testCase)
Return true if a delta put in this vm is the case where a warning is logged.
|
protected static String |
keysToString(Collection listOfKeys)
Logs a Collection of keys, inserting line breaks for large key lists.
|
protected void |
loadToUpperThreshold(com.gemstone.gemfire.cache.Region aReg)
Load the region with N entries, specified by DeltaPropagationPrms.upperThreshold.
|
protected static void |
logExecutionNumber()
Log the execution number of this serial task.
|
static void |
logPRMembers(com.gemstone.gemfire.cache.Region reg,
Object key)
Log primary and secondary members for the key and value for this event
|
protected boolean |
modifyDeltaObject(DeltaObject anObj)
Modify 1 or more primitive fields of the given DeltaObject.
|
protected void |
recordLoadToBB()
Record the state of the region to the blackbloard for serial tests.
|
protected static void |
registerInterest(com.gemstone.gemfire.cache.Region aRegion)
Register interest with ALL_KEYS, and InterestPolicyResult = KEYS_VALUES
which is equivalent to a full GII.
|
protected void |
saveEvictionStats(long numBytesInVM)
Make the current values the before values
|
protected boolean |
thisVMHostsKey(com.gemstone.gemfire.cache.Region aReg,
Object key)
Return true if the region hosts the key in this vm.
|
protected void |
trackUpdate(com.gemstone.gemfire.cache.Region aReg,
Object key,
boolean isDeltaDistribution)
Update tracking of updated keys to be used for later validation
|
protected Object[] |
updateDeltaValueHolder(List currentKeyList)
Perform an update on an existing key.
|
protected void |
updateEntry(com.gemstone.gemfire.cache.Region aReg)
Update an existing entry in the given region.
|
protected void |
verifyDeltaBehavior()
Verify that the delta behavior was correct (toDelta/fromDelta was called
and NOT called when appropriate, and cloning was handled correctly).
|
protected static void |
verifyDeltaCalls(int vmID,
List deltaKeys,
String whichDelta,
List expectedKeys)
Verify that the given deltaKeys are expected.
|
protected void |
verifyEviction()
Verify eviction (both for all entries in the cache and for the last operation
|
protected void |
verifyNoUpdates()
Verify that no updates have occured.
|
protected void |
verifyRegionContents(Map expected)
Verify the state of the region and the given expected snapshot.
|
protected void |
verifyValue(Object key,
BadDeltaObject expectedValue)
Verify that the given key has the given value.
|
protected void |
writeDeltaInfoToBlackboard()
Write this vm's delta and cloning information to the blackboard
to be used later for verification.
|
public static DeltaTest testInstance
protected static final String redundantCopiesKey
protected static final String toDeltaKey
protected static final String fromDeltaKey
protected static final String hasDeltaKey
protected static final String updatedKeysKey
protected static final String updatedKeysWithDeltaKey
protected static final String updatedKeysNotDistKey
protected static final String regionSnapshotKey
protected long minTaskGranularitySec
protected long minTaskGranularityMS
protected int numOpsPerTask
public boolean isBridgeConfiguration
public boolean isBridgeClient
protected int numThreadsInClients
public com.gemstone.gemfire.cache.Region aRegion
public HydraThreadLocal uniqueKeyIndex
protected boolean isSerialExecution
protected boolean highAvailability
protected int upperThreshold
protected int lowerThreshold
protected boolean uniqueKeys
protected int numQueriesPerClientVM
protected int secondsToRun
protected boolean cacheIsClosed
protected boolean disconnected
protected int numThreadsInThisVM
protected int numFieldsToModify
protected List<com.gemstone.gemfire.cache.Region> multiRegionList
protected List updatedKeys
protected List updatedKeysWithDelta
protected List updatedKeysNotDistributed
protected int numberOfCycles
protected int redundantCopies
protected Map regionSnapshot
protected long before_stat_entriesInVM
protected long before_stat_numOverflowOnDisk
protected long before_numBytesInThisVM
protected long before_stat_lruEvictions
protected String opKey
protected String currentKeyListKey
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 ENTRY_MODIFY_VALUE
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
protected static final String fullDistribution
protected static volatile MethodCoordinator concVerifyCoordinator
public static void HydraTask_initializeClient()
public static void HydraTask_initializeBridgeServer()
public com.gemstone.gemfire.cache.Region initializeRegion(String regDescriptName)
regDescriptName - The name of a region description.public void initializeInstance()
public static void HydraTask_initMultiRegions()
public static void HydraTask_initMultiRegionsForClients()
public static void HydraTask_doRROpsAndVerify()
public static void HydraTask_doConcOpsAndVerify()
public static void HydraTask_doConcOps()
public static void HydraTask_doConcOpsWithMultiRegions()
public static void HydraTask_HADoEntryOps()
public static void HydraTask_HAController()
public static void HydraTask_loadBadDeltaToUpperThreshold()
public static void HydraTask_loadToUpperThreshold()
public static void HydraTask_evictionTestLoad()
public static void HydraTask_loadMultiRegToUpperThreshold()
public static void HydraTask_recordLoadToBB()
public static void HydraTask_initRedundantCopies()
public static void HydraTask_verifyNoDeltaCalls()
public static void HydraTask_badDeltaController()
public static void HydraTask_doMixedTest()
public static void HydraTask_doSerialRREvictionTest()
public static void HydraTask_checkMemLRULevelForPR()
public static void HydraTask_checkOverageHistory()
protected void doRROpsAndVerify()
protected void doConcOpsAndVerify()
protected void HAController()
protected void HADoEntryOps()
protected void doEntryOperations(com.gemstone.gemfire.cache.Region aReg)
protected void loadToUpperThreshold(com.gemstone.gemfire.cache.Region aReg)
protected void evictionTestLoad(com.gemstone.gemfire.cache.Region aReg)
protected void recordLoadToBB()
protected Object addEntry(com.gemstone.gemfire.cache.Region aReg)
aRegion - The region to use for adding a new entry.protected void invalidateEntry(com.gemstone.gemfire.cache.Region aReg,
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 aReg,
boolean isLocalDestroy)
aRegion - The region to use for destroying an entry.isLocalDestroy - True if the destroy should be local, false otherwise.protected void updateEntry(com.gemstone.gemfire.cache.Region aReg)
aRegion - The region to use for updating an entry.protected void getKey(com.gemstone.gemfire.cache.Region aReg)
aRegion - The region to use for getting an entry.protected void getNewKey(com.gemstone.gemfire.cache.Region aReg)
aRegion - The region to use for getting an entry.protected Object getNewKey()
protected static void logExecutionNumber()
protected static void registerInterest(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to register interest on.protected void badDeltaController(int testCase)
protected Object getKeyForBadDeltaTest()
protected void handleBadDeltaException(Class expected, Throwable got, boolean expectedIsFromRemoteVM)
expected - The class of the expected exception.got - The exception the test caught.expectedIsFromRemoteVM - true if the expected exception was expected to be returned
from a remote vm, false if the expected exception was expected to be generated
from the current vm.protected void handleBadDeltaSuccessfulUpdate(int badDeltaTestCase,
Class expectedExceptionClass,
Object key,
BadDeltaObject value)
expectedExceptionClass - The class of the expected exception for the update
to be used IF this method determines that an exception should have been
returned to the caller of the put.
There is only 1 case where a failed delta call logs a warning and lets the
update occur: the update occurs in a server and there are no server peers
to distribute to (redundantCopies = 0 or no other servers), and the only
member to distribute to is a client---in this case the server put succeeds
and the client logs a warning.protected void concVerify()
protected void verifyRegionContents(Map expected)
protected void writeDeltaInfoToBlackboard()
protected void clear()
protected void verifyDeltaBehavior()
protected static void verifyDeltaCalls(int vmID,
List deltaKeys,
String whichDelta,
List expectedKeys)
vmID - The vmID this is doing validation for.deltaKeys - The list of keys whose values had a delta call.whichDelta - "to" if this is validating toDelta calls,
"from" if this is validating fromDelta calls, "has" if this
is validating hasDelta calls.expectedKeys - The List of keys whose values are expected to
have had toDelta/fromDelta/hasDelta called on them.protected void verifyNoUpdates()
public void doSerialRREvictionTest()
protected void doEvictionTestOps()
protected String addNewValue()
protected Object[] updateDeltaValueHolder(List currentKeyList)
protected void verifyEviction()
protected void saveEvictionStats(long numBytesInVM)
protected void checkEviction()
protected long checkMemLRULevelForPR()
protected void checkOverageHistory()
protected boolean thisVMHostsKey(com.gemstone.gemfire.cache.Region aReg,
Object key)
aReg - A partitioned region.protected void verifyValue(Object key, BadDeltaObject expectedValue)
key - The key to check.expectedValue - The expected value of key.protected int getOperation(Long whichPrm)
whichPrm - A hydra parameter which specifies random operations.public static Object getExistingKey(com.gemstone.gemfire.cache.Region aRegion, boolean uniqueKeys, int numThreads)
aRegion - The region to use for getting an existing key.uniqueKeys - True if each thread operates on a unique set of keys.numThreads - Used if uniqueKeys is true. This is the number of
threads using uniqueKeys.protected void checkForLastIteration()
protected void handleException(Exception anExcept)
protected boolean modifyDeltaObject(DeltaObject anObj)
anObj - The DeltaObject to modifyprotected void trackUpdate(com.gemstone.gemfire.cache.Region aReg,
Object key,
boolean isDeltaDistribution)
protected static void checkForError()
protected static String keysToString(Collection listOfKeys)
protected boolean isBadDeltaWarningCase(int testCase)
public static void logPRMembers(com.gemstone.gemfire.cache.Region reg,
Object key)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.