public class Feeder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
deltaType |
static boolean |
isClient |
static java.util.HashMap |
keyToMap |
static java.lang.String |
LAST_KEY
The last key to be put by feeder.
|
protected static java.util.Map |
latestValues
A Map which contains a thread-id as key and a map as value.
|
protected static java.lang.String |
REGION_NAME |
| Constructor and Description |
|---|
Feeder() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeTask()
Signals for stopping of the put threads and notifies all.
|
protected static void |
createEntry(com.gemstone.gemfire.cache.Region region)
Perform create operation for a random key within PUT_KEY_RANGE
|
protected static void |
destroyEntry(com.gemstone.gemfire.cache.Region region)
Perform destroy operation for a random key within PUT_KEY_RANGE
|
static void |
doNothing() |
static void |
feederCreateRegions()
This method is an INITTASK and does the following :
1)Create cache adn region |
static void |
feederIsClient() |
static void |
feederSpawnThreads()
This method is an INITTASK and does the following :
2)Set the counters for all threads to 1 ( to run them once in INITTASK) 3)Initialize and start the put threads |
static void |
feederTask()
Increments the value of counters in
threadList for each
thread and notifies all the put threads int wait(). |
static void |
feederTimedTask()
|
protected static DeltaTestObj |
getLatestDelta(java.lang.String key,
java.lang.String threadIdKey,
boolean isCreate)
Gets the latest delta for the given key from the latestValues map and
returns the incremented value for doing entry operations.
|
protected static java.lang.Long |
getLatestValue(java.lang.String key,
java.lang.String threadIdKey)
Gets the latest value for the given key from the latestValues map and
returns the incremented value for doing entry operations.
|
static void |
initTask()
This method is an INITTASK and does the following :
1)Create cache adn region 2)Set the counters for all threads to 1 ( to run them once in INITTASK) 3)Initialize and start the put threads |
static void |
initTaskOnBridge() |
static void |
initToFeedMixOfDeltaAndOthers()
This method is an INITTASK and does the following :
1)Create cache adn region 2)Set the counters for all threads to 1 ( to run them once in INITTASK) 3)Initialize and start the put threads 4)Put object of Delta or Byte[] type |
protected static void |
invalidateEntry(com.gemstone.gemfire.cache.Region region)
Perform invalidate operation for a random key within PUT_KEY_RANGE
|
static void |
noResetTask() |
static void |
populateSharedMapWithRegionData() |
protected static void |
registerInterest(com.gemstone.gemfire.cache.Region region)
Perform registerInterest operation for a random key within PUT_KEY_RANGE
|
protected static void |
unregisterInterest(com.gemstone.gemfire.cache.Region region)
Perform unregisterInterest operation for a random key within PUT_KEY_RANGE
|
protected static void |
updateEntry(com.gemstone.gemfire.cache.Region region)
Perform put operation for a random key within PUT_KEY_RANGE
|
protected static boolean |
updateLatestValueMap(com.gemstone.gemfire.cache.Region region,
java.lang.String key,
java.lang.String threadId,
boolean isDestroyCall)
Updates the local
latestValues map on a invalidate or
destroy call. |
static void |
verifyDeltaFailuresInC2S() |
static void |
verifyDeltaFailuresInP2P() |
static void |
verifyDeltaFailuresInS2C() |
static void |
waitForFeederThreadsToComplete()
Signals for stopping of the put threads and notifies all.
|
protected static final java.util.Map latestValues
protected static final java.lang.String REGION_NAME
protected final java.lang.String deltaType
public static final java.lang.String LAST_KEY
public static boolean isClient
public static java.util.HashMap keyToMap
protected static void createEntry(com.gemstone.gemfire.cache.Region region)
region - -
the test regionprotected static void updateEntry(com.gemstone.gemfire.cache.Region region)
region - -
the test regionprotected static void invalidateEntry(com.gemstone.gemfire.cache.Region region)
region - -
the test regionprotected static void destroyEntry(com.gemstone.gemfire.cache.Region region)
region - -
the test regionprotected static void registerInterest(com.gemstone.gemfire.cache.Region region)
region - -
the test regionprotected static void unregisterInterest(com.gemstone.gemfire.cache.Region region)
region - -
the test regionpublic static void feederTimedTask()
public static void feederTask()
threadList for each
thread and notifies all the put threads int wait().public static void populateSharedMapWithRegionData()
public static void closeTask()
TOTAL_PUT_THREADS * PUT_KEY_RANGE. This is
done because the first set of PUTs by each thread will correspond to CREATE
operations and UPDATES afterwards.public static void verifyDeltaFailuresInC2S()
public static void verifyDeltaFailuresInP2P()
public static void verifyDeltaFailuresInS2C()
public static void waitForFeederThreadsToComplete()
protected static java.lang.Long getLatestValue(java.lang.String key,
java.lang.String threadIdKey)
key - -
the event keythreadIdKey - -
thread-id to which this key belongsprotected static DeltaTestObj getLatestDelta(java.lang.String key, java.lang.String threadIdKey, boolean isCreate)
key - -
the event keythreadIdKey - -
thread-id to which this key belongsisCreate - - create or update operationprotected static boolean updateLatestValueMap(com.gemstone.gemfire.cache.Region region,
java.lang.String key,
java.lang.String threadId,
boolean isDestroyCall)
throws java.lang.Exception
latestValues map on a invalidate or
destroy call.key - -
the event keythreadId - -
thread-id to which this key belongsisDestroyCall - -
true if this method was called for doing destroy operation, false
if invalidate operationjava.lang.Exception - -
thrown if any exception occurs while fetching the old value from
the regionpublic static void initToFeedMixOfDeltaAndOthers()
public static void initTask()
public static void feederCreateRegions()
public static void feederSpawnThreads()
public static void initTaskOnBridge()
public static void doNothing()
public static void feederIsClient()
public static void noResetTask()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.