use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class AllEntrySetTest method prepare.
@Prepare(global = true)
public void prepare() {
Streamer<String, String> streamer = StreamerFactory.getInstance(map);
for (int i = 0; i < entryCount; i++) {
String key = generateString(keyLength);
String value = generateString(valueLength);
streamer.pushEntry(key, value);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class AllValuesTest method prepare.
@Prepare(global = true)
public void prepare() {
Streamer<String, String> streamer = StreamerFactory.getInstance(map);
for (int i = 0; i < entryCount; i++) {
String key = generateString(keyLength);
String value = generateString(valueLength);
streamer.pushEntry(key, value);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class MapComplexPredicateTest method prepare.
@Prepare(global = true)
public void prepare() {
Streamer<String, ComplexDomainObject> streamer = StreamerFactory.getInstance(map);
for (int i = 0; i < mapSize; i++) {
ComplexDomainObject value = createQuickSearchObject(i);
String key = value.getQuickSearchKey();
streamer.pushEntry(key, value);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class MapTransactionReadWriteTest method prepare.
@Prepare
public void prepare() {
waitClusterSize(logger, targetInstance, minNumberOfMembers);
keys = generateIntKeys(keyCount, keyLocality, targetInstance);
Random random = new Random();
Streamer<Integer, Integer> streamer = StreamerFactory.getInstance(map);
for (int key : keys) {
int value = random.nextInt(Integer.MAX_VALUE);
streamer.pushEntry(key, value);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class MapPutAllTest method prepare.
@Prepare
@SuppressWarnings("unchecked")
public void prepare() {
Object[] keys = keyType.generateKeys(targetInstance, keyLocality, keyCount, keySize);
inputMaps = new Map[mapCount];
Random random = new Random();
for (int mapIndex = 0; mapIndex < mapCount; mapIndex++) {
// generate a SortedMap or HashMap depending on the configuration
Map<Object, Object> tmpMap = (useSortedMap ? new TreeMap<Object, Object>() : new HashMap<Object, Object>(itemCount));
while (tmpMap.size() < itemCount) {
Object key = keys[random.nextInt(keyCount)];
Object value = valueType.generateValue(random, valueSize);
tmpMap.put(key, value);
}
inputMaps[mapIndex] = tmpMap;
}
}
Aggregations