public class InitImageTest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
ADD_NEW_KEY |
com.gemstone.gemfire.cache.Region |
aRegion |
protected long |
createRegionDurationMS |
protected static int |
DESTROY |
protected static int |
FIRST_OP |
protected static int |
GET |
protected long |
giiDurationMS |
protected static int |
INVALIDATE |
KeyIntervals |
keyIntervals |
protected static int |
LAST_OP |
protected static int |
LOCAL_DESTROY |
protected static int |
LOCAL_INVALIDATE |
protected long |
LOG_INTERVAL_MILLIS |
protected int |
numNewKeys |
protected static int[] |
operations |
protected static int |
PUTALL_NEW_KEY |
protected RandomValues |
randomValues |
protected static String |
REGION_NAME |
protected SharedCounters |
sc |
protected int |
sleepMSAfterOps |
protected boolean |
supportsConcurrentMap |
protected static InitImageTest |
testInstance |
protected int |
totalNumKeys |
protected static int |
UPDATE_EXISTING_KEY |
| Constructor and Description |
|---|
InitImageTest() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addNewKey()
Add a new key to REGION_NAME.
|
protected void |
blockedGetRegion()
Wait for another thread in this VM to begin a getInitialImage, then get the region
REGION_NAME, which should block while somebody else has a getInitialImage in progress.
|
protected void |
checkContainsKey(Object key,
boolean expected,
String logStr)
Check that containsKey() called on the tests' region has the expected result.
|
protected void |
checkContainsValueForKey(Object key,
boolean expected,
String logStr)
Check that containsValueForKey() called on the tests' region has the expected result.
|
protected void |
checkUpdatedValue(Object key,
Object value)
Check that the value of the given key is expected as an updated value.
|
protected void |
checkValue(Object key,
Object value)
Check that the value of the given key is expected for this test.
|
protected BaseValueHolder |
createObject(Object key) |
protected BaseValueHolder |
createObject(Object key,
RandomValues values) |
protected boolean |
destroy()
Destroy a key in region REGION_NAME.
|
protected void |
doGetInitImage(boolean withMonitor)
Get the region REGION_NAME, which should do a getInitialImage.
|
protected void |
doNewKeyGets()
Do gets with keys that do not exist in the system.
|
void |
doOps(BitSet availableOps)
Do operations on the REGION_NAME's keys using keyIntervals to specify
which keys get which operations.
|
protected void |
doOpsPlusPuts()
Do keyInterval operations during the gii, then wait for the gii to complete.
|
protected boolean |
get()
Do a get on a key in region REGION_NAME.
|
protected com.gemstone.gemfire.cache.CacheLoader |
getCacheLoader()
Return a cache loader to install into a region, or null of none
InitImagePrms.useCacheLoader is used to determine if a cache loader
should be installed.
|
protected com.gemstone.gemfire.cache.CacheWriter |
getCacheWriter()
Return a cache writer to install into a region, or null if none
InitImagePrms.useCacheWriter is used to determine if a cache writer
should be installed.
|
protected int |
getOp(BitSet bs,
int bsSize)
Get a random operation to perform.
|
protected Set |
getRegionKeySet(com.gemstone.gemfire.cache.Region aRegion) |
protected Object |
getValueToAdd(Object key)
Return a value to add to a region for the given key
|
protected static boolean |
hasLocalGiiCompleted()
Test whether the local GII has completed.
|
static void |
HydraTask_blockedGetRegion()
Hydra task to wait until another thread does a getInitialImage, then this
get region should block.
|
static void |
HydraTask_doCacheWriterTest()
Hydra task to do operations that will cause a CacheWriter to be
invoked in the VM doing a getInitialImage.
|
static void |
HydraTask_doGetInitImage()
Hydra task to do a get region, which does a getInitialImage.
|
static void |
HydraTask_doGetInitImageWithoutMonitor()
Hydra task to do a get region, which does a getInitialImage.
|
static void |
HydraTask_doNewKeyGets()
Hydra task to do gets with new keys (ie not anywhere in the system)
|
static void |
HydraTask_doOps()
Hydra task to perform operations according to keyIntervals on an previously
initialized region.
|
static void |
HydraTask_doPutAllNewKey()
Hydra task to perform local destroy operations, according to keyIntervals on a previously
initialized region.
|
static void |
HydraTask_initCache()
Hydra task to initialize the cache
|
static void |
HydraTask_loadRegion()
Hydra task to initialize a region and load it according to hydra param settings.
|
static void |
HydraTask_loadRegionWithGets()
Hydra task to initialize a region and load it by getting values from another
distributed system using gets.
|
static void |
HydraTask_verifyCacheWriterTest()
Hydra task to verify that a CacheWriters are not invoked during a GII.
|
static void |
HydraTask_verifyEventCounters()
Hydra task to verify event counters.
|
static void |
HydraTask_verifyGII() |
static void |
HydraTask_verifyNonBlocking()
Hydra task to verify that operations concurrent to getInitialImage
are non-blocking.
|
static void |
HydraTask_verifyRegionContents()
Hydra task to verify the keys and values in a region using keyIntervals.
|
protected static void |
initializeInstance()
Initialize the single instance of this test class but not a region.
|
protected static void |
initializeRegion(com.gemstone.gemfire.cache.DataPolicy dataPolicy)
Initialize the single instance of this test class and a region.
|
void |
initInstance()
Initialize fields for this instance
|
protected void |
initRegion(com.gemstone.gemfire.cache.DataPolicy dataPolicy)
Initialize a region with the desired attributes.
|
protected boolean |
invalidate()
Invalidate a key in region REGION_NAME.
|
protected static boolean |
isAnyGiiInProgress()
Test whether any GII is in progress.
|
protected static boolean |
isLocalGiiInProgress()
Test whether a local GII is in progress.
|
protected static boolean |
isLocalGiiInProgress(com.gemstone.gemfire.cache.Region aRegion)
Test whether a local GII is in progress.
|
void |
loadRegion()
Load a region with keys and values.
|
void |
loadRegionWithGets()
Loads a region with keys and values by getting the value from another
distributed system.
|
protected boolean |
localDestroy()
Locally destroy a key in region REGION_NAME.
|
protected boolean |
localInvalidate()
Locally invalidate a key in region REGION_NAME.
|
protected boolean |
putAllNewKey()
Add a group of new keys via putAll to REGION_NAME.
|
static void |
StartTask_initialize()
Hydra start task to initialize key intervals, which are ranges of
keys which are to have an operation done on them (invalidate, destroy, etc)
|
protected boolean |
updateExistingKey()
Update an existing key in region REGION_NAME.
|
protected void |
verifyCacheWriterTest()
Verify counters to show that the cache writer installed in the VM doing
the getInitialImage was not invoked while GII was in progress, but gets
invoked when GII is not in progress.
|
protected void |
verifyEventCounters() |
void |
verifyNonBlocking()
Verify that the region operations that occurred did not block.
|
void |
verifyRegionContents()
Verify the contents of the region, taking into account the keys
that were destroyed, invalidted, etc (as specified in keyIntervals)
Throw an error of any problems are detected.
|
protected static void |
waitForAllGiiToComplete()
Wait for getInitialImage in ALL vms to complete.
|
static void |
waitForAnyGiiToBegin()
Wait for a getInitialImage in ANY vm to be in progress.
|
protected static void |
waitForLocalGiiCompleted()
Wait for stats to indicate that a getInitialImage has completed.
|
protected static void |
waitForLocalGiiToBegin()
Wait for stats to indicate that a getInitialImage is in progress.
|
protected static InitImageTest testInstance
protected static final String REGION_NAME
protected RandomValues randomValues
protected int numNewKeys
public KeyIntervals keyIntervals
protected int totalNumKeys
public com.gemstone.gemfire.cache.Region aRegion
protected long createRegionDurationMS
protected long giiDurationMS
protected SharedCounters sc
protected int sleepMSAfterOps
protected boolean supportsConcurrentMap
protected static final int INVALIDATE
protected static final int LOCAL_INVALIDATE
protected static final int DESTROY
protected static final int LOCAL_DESTROY
protected static final int UPDATE_EXISTING_KEY
protected static final int GET
protected static final int ADD_NEW_KEY
protected static final int PUTALL_NEW_KEY
protected static final int FIRST_OP
protected static final int LAST_OP
protected static final int[] operations
protected final long LOG_INTERVAL_MILLIS
protected static void initializeRegion(com.gemstone.gemfire.cache.DataPolicy dataPolicy)
protected static void initializeInstance()
protected void initRegion(com.gemstone.gemfire.cache.DataPolicy dataPolicy)
public void initInstance()
public static void StartTask_initialize()
public static void HydraTask_loadRegion()
public static void HydraTask_loadRegionWithGets()
public static void HydraTask_doOps()
public static void HydraTask_doPutAllNewKey()
public static void HydraTask_doGetInitImage()
public static void HydraTask_doGetInitImageWithoutMonitor()
public static void HydraTask_blockedGetRegion()
public static void HydraTask_verifyRegionContents()
public static void HydraTask_verifyEventCounters()
public static void HydraTask_initCache()
public static void HydraTask_verifyNonBlocking()
public static void HydraTask_doNewKeyGets()
public static void HydraTask_doCacheWriterTest()
public static void HydraTask_verifyCacheWriterTest()
protected void doGetInitImage(boolean withMonitor)
protected void blockedGetRegion()
public void loadRegion()
public void loadRegionWithGets()
public void doOps(BitSet availableOps)
availableOps - - Bits which are true correspond to the operations
that should be executed.protected boolean addNewKey()
protected boolean putAllNewKey()
protected boolean updateExistingKey()
protected boolean localInvalidate()
protected boolean invalidate()
protected boolean localDestroy()
protected boolean destroy()
protected boolean get()
protected void doNewKeyGets()
protected void doOpsPlusPuts()
public void verifyRegionContents()
public void verifyNonBlocking()
protected void verifyEventCounters()
protected void verifyCacheWriterTest()
protected void checkContainsKey(Object key, boolean expected, String logStr)
key - The key to check.expected - The expected result of containsKeylogStr - Used if throwing an error due to an unexpected value.protected void checkContainsValueForKey(Object key, boolean expected, String logStr)
key - The key to check.expected - The expected result of containsValueForKeylogStr - Used if throwing an error due to an unexpected value.protected void checkValue(Object key, Object value)
key - The key to check.value - The value for the key.logStr - Used if throwing an error due to an unexpected value.protected void checkUpdatedValue(Object key, Object value)
key - The key to check.value - The value for the key.logStr - Used if throwing an error due to an unexpected value.protected int getOp(BitSet bs, int bsSize)
bs - True bits correspond to operations available to be chosen.bsSize - The number of bits to consider.protected com.gemstone.gemfire.cache.CacheLoader getCacheLoader()
protected com.gemstone.gemfire.cache.CacheWriter getCacheWriter()
protected Object getValueToAdd(Object key)
protected BaseValueHolder createObject(Object key)
protected BaseValueHolder createObject(Object key, RandomValues values)
protected Set getRegionKeySet(com.gemstone.gemfire.cache.Region aRegion)
protected static boolean isLocalGiiInProgress()
protected static boolean isLocalGiiInProgress(com.gemstone.gemfire.cache.Region aRegion)
The - region that may be in a getInitialImageprotected static boolean hasLocalGiiCompleted()
protected static boolean isAnyGiiInProgress()
public static void waitForAnyGiiToBegin()
protected static void waitForAllGiiToComplete()
protected static void waitForLocalGiiToBegin()
protected static void waitForLocalGiiCompleted()
public static void HydraTask_verifyGII()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.