public class Feeder extends Object
| Modifier and Type | Field and Description |
|---|---|
static ArrayList |
keyList |
static String |
LAST_KEY
The last key to be put by feeder.
|
protected static Map |
latestValues
A Map which contains a thread-id as key and a map as value.
|
static ArrayList |
partialList |
protected static 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 |
feederTask()
Increments the value of counters in
threadList for each
thread and notifies all the put threads int wait(). |
protected static Long |
getLatestValue(String key,
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 |
protected static void |
invalidateEntry(com.gemstone.gemfire.cache.Region region)
Perform invalidate operation for a random key within PUT_KEY_RANGE
|
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,
String key,
String threadId,
boolean isDestroyCall)
Updates the local
latestValues map on a invalidate or
destroy call. |
static void |
waitForFeederThreadsToComplete()
Signals for stopping of the put threads and notifies all.
|
protected static final Map latestValues
public static ArrayList keyList
public static ArrayList partialList
protected static final String REGION_NAME
public static final String LAST_KEY
public static void initTask()
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 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 waitForFeederThreadsToComplete()
protected static Long getLatestValue(String key, String threadIdKey)
key - -
the event keythreadIdKey - -
thread-id to which this key belongsprotected static boolean updateLatestValueMap(com.gemstone.gemfire.cache.Region region,
String key,
String threadId,
boolean isDestroyCall)
throws 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 operationException - -
thrown if any exception occurs while fetching the old value from
the regionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.