public class SnapshotTest extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SnapshotTest.KeySnapshotFilter
Key SnapshotFilter only accepts original entries (created before snapshot written)
based on the key (FilterObject_XXX vs.
|
static class |
SnapshotTest.ValueSnapshotFilter
Value SnapshotFilter only accepts original entries (created before snapshot written)
based on the value (value should NOT start with this string "object to be filtered").
|
static class |
SnapshotTest.ValueTypeSnapshotFilter
Value Type SnapshotFilter only accepts original entries (created before snapshot written)
based on the value type (ValueHolders are accepted, String values are not).
|
| Modifier and Type | Field and Description |
|---|---|
protected static int |
CACHE_OPERATIONS |
protected static String |
createCallbackPrefix |
protected static String |
destroyCallbackPrefix |
protected static int |
ENTRY_ADD_OPERATION |
protected static int |
ENTRY_DESTROY_OPERATION |
protected static int |
ENTRY_GET_NEW_OPERATION |
protected static int |
ENTRY_GET_OPERATION |
protected static int |
ENTRY_INVALIDATE_OPERATION |
protected static int |
ENTRY_LOCAL_DESTROY_OPERATION |
protected static int |
ENTRY_LOCAL_INVALIDATE_OPERATION |
protected static int |
ENTRY_PUTALL_OPERATION |
protected static int |
ENTRY_UPDATE_OPERATION |
protected static String |
getCallbackPrefix |
protected static String |
invalidateCallbackPrefix |
protected static String |
regionDestroyCallbackPrefix |
protected static String |
regionInvalidateCallbackPrefix |
static SnapshotTest |
testInstance
instance of this test class
|
protected static String |
updateCallbackPrefix |
| Constructor and Description |
|---|
SnapshotTest() |
| 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 |
addEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Add a new entry to the given region.
|
protected static void |
checkForLastIteration()
Check if we have run for the desired length of time.
|
static void |
CloseTask_closeCache()
Close the cache gracefully (so we can remove the underlying disk store files).
|
void |
createColocatedRegions() |
protected void |
destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalDestroy)
Destroy an entry in the given region.
|
protected void |
destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalDestroy)
Destroy an entry in the given region.
|
protected void |
doOperations(long msToRun)
Do random operations on the cache and any defined regions in this vm.
|
protected void |
doRebalance()
do a rebalance operation
|
protected void |
getExistingKey(com.gemstone.gemfire.cache.Region aRegion)
Does a get operation on an existing key.
|
protected void |
getNewKey(com.gemstone.gemfire.cache.Region aRegion)
Get a new key in the given region.
|
protected int |
getOperation(Long whichPrm)
Get a random operation using the given hydra parameter.
|
protected int |
getOperation(com.gemstone.gemfire.cache.Region aRegion)
Get an operation to perform on the region
|
protected Map |
getPutAllMap(com.gemstone.gemfire.cache.Region aRegion)
Get a map to use for putAll for the given region.
|
protected com.gemstone.gemfire.cache.snapshot.SnapshotFilter |
getSnapshotFilter()
Randomly select one of the SnapshotFilters (Key, Value or ValueType)
Returns instance of SnapshotFilter.
|
protected void |
getThisNewKey(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Do a get on the given new key.
|
protected Object |
getUpdateObject(com.gemstone.gemfire.cache.Region r,
String key)
Return an object to be used to update the given key.
|
static BaseValueHolder |
getVersionedValueHolder(String valueClassName,
String key,
RandomValues randomValues) |
protected void |
handleOperationExceptions(com.gemstone.gemfire.cache.Region aRegion,
Exception e)
Handle Exceptions which can be thrown from entry operations during Cache Close/Shutdown
|
protected void |
handleRebalanceException(Exception e)
Handle Exceptions thrown during rebalance (which occur from closing the cache, recycling vms)
|
static void |
HydraTask_createColocatedRegions()
Creates and initializes colocated regions in a peer vm
|
static void |
HydraTask_initialize()
Creates and initializes a server or peer.
|
static void |
HydraTask_initializeController()
Initialization for snapshot controller.
|
static void |
HydraTask_initializeResponder()
Initialize import and verify coordinators as these steps occur after
the responder vms have been recycled.
|
static void |
HydraTask_loadRegion()
Hydra task to load the region with keys/values.
|
static void |
HydraTask_removeDiskFiles()
Remove disk files in disk dirs corresponding to this vm's vmID.
|
static void |
HydraTask_resetUniqueKeyIndex()
Reset the uniqueKeyIndex to be higher than the current blackboard counter
|
static void |
HydraTask_snapshotController()
Hydra task to run the snapshot controller thread.
|
static void |
HydraTask_snapshotResponder()
Hydra task to run the responder threads for snapshot tests.
|
static void |
HydraTask_startBridgeServer()
Starts the bridge server in this VM.
|
static void |
initPdxClassLoader() |
static boolean |
instanceOfPdxInstance(Object value) |
protected void |
invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
boolean isLocalInvalidate)
Invalidate an entry in the given region.
|
protected void |
invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalInvalidate)
Invalidate an entry in the given region.
|
protected static long |
logExecutionNumber()
Log the execution number of this serial task.
|
protected Object |
obtainExistingKey(com.gemstone.gemfire.cache.Region aRegion)
Return a random key from aRegion
|
protected List<String> |
obtainExistingKeys(com.gemstone.gemfire.cache.Region aRegion,
int numToObtain)
Return a random key from aRegion
|
protected Object |
obtainNewKey()
Return a new key, never before used in the test.
|
protected void |
putAll(com.gemstone.gemfire.cache.Region aRegion)
putall a map to the given region.
|
static List |
shutDownAll()
Task to do a shutDownAll on the worker vms
|
static BaseValueHolder |
toValueHolder(Object value) |
protected void |
updateEntry(com.gemstone.gemfire.cache.Region aRegion)
Update an existing entry in the given region.
|
protected void |
updateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Update an existing entry in the given region.
|
void |
verifyFromSnapshot(com.gemstone.gemfire.cache.Region aRegion,
Map regionSnapshot)
Verify that the given region is consistent with the given snapshot.
|
public static SnapshotTest 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 ENTRY_PUTALL_OPERATION
protected static final int CACHE_OPERATIONS
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 void HydraTask_initialize()
throws Throwable
Throwablepublic static void HydraTask_createColocatedRegions()
throws Throwable
Throwablepublic void createColocatedRegions()
public static void HydraTask_startBridgeServer()
public static void HydraTask_initializeController()
public static void HydraTask_loadRegion()
public static void HydraTask_resetUniqueKeyIndex()
public static void HydraTask_snapshotController()
public static void HydraTask_snapshotResponder()
throws Exception
Exceptionpublic static List shutDownAll()
public static void HydraTask_initializeResponder()
protected com.gemstone.gemfire.cache.snapshot.SnapshotFilter getSnapshotFilter()
public void verifyFromSnapshot(com.gemstone.gemfire.cache.Region aRegion,
Map regionSnapshot)
aRegion - The region to verifysnapshot - The expected contents of aRegion.protected void doRebalance()
protected void doOperations(long msToRun)
throws Exception
msToRun - The number of milliseconds to run operations before returning.Exceptionprotected int getOperation(com.gemstone.gemfire.cache.Region aRegion)
reg - The region to get an operation for.protected int getOperation(Long whichPrm)
whichPrm - A hydra parameter which specifies random operations.protected void getExistingKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to perform the get on.protected Object addEntry(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for adding a new entry.protected void addEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region to use for adding a new entry.key - The key to add.protected void putAll(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for putall a map.protected Map getPutAllMap(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to consider for the putAll.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 invalidateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalInvalidate)
aRegion - The region to use for invalidating an entry.key - The key to invalidate.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 void destroyEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key,
boolean isLocalDestroy)
aRegion - The region to use for destroying an entry.key - The key to destroy.isLocalDestroy - True if the destroy should be local, false otherwise.protected void updateEntry(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for updating an entry.protected void updateEntry(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region to use for updating an entry.key - The key to update.protected void getNewKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to use for getting an entry.protected void getThisNewKey(com.gemstone.gemfire.cache.Region aRegion,
Object key)
aRegion - The region to use for getting an entry.key - A new key never used before.protected Object obtainExistingKey(com.gemstone.gemfire.cache.Region aRegion)
aRegion - The region to get the existing key from.protected List<String> obtainExistingKeys(com.gemstone.gemfire.cache.Region aRegion, int numToObtain)
aRegion - The region to get the existing key from.protected static long logExecutionNumber()
protected static void checkForLastIteration()
protected Object obtainNewKey()
protected Object getUpdateObject(com.gemstone.gemfire.cache.Region r, String key)
aRegion - The region which possible contains key.key - The key to get a new value for.protected void handleRebalanceException(Exception e)
- - Exception eprotected void handleOperationExceptions(com.gemstone.gemfire.cache.Region aRegion,
Exception e)
- - Region involved in failed operation- - Exception epublic static void CloseTask_closeCache()
public static void HydraTask_removeDiskFiles()
public static void initPdxClassLoader()
public static BaseValueHolder getVersionedValueHolder(String valueClassName, String key, RandomValues randomValues)
valueClassName - key - randomValues - public static boolean instanceOfPdxInstance(Object value)
value - public static BaseValueHolder toValueHolder(Object value)
value - Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.