use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class IntBytesICacheCircuitBreakerTest method prepare.
@Prepare
public void prepare() {
Random random = new Random();
values = new byte[valueCount][];
for (int i = 0; i < values.length; i++) {
int delta = valueMaxSize - valueMinSize;
int length = delta == 0 ? valueMinSize : valueMinSize + random.nextInt(delta);
values[i] = generateByteArray(random, length);
}
Streamer<Integer, Object> streamer = StreamerFactory.getInstance(cache);
for (int key : keys) {
streamer.pushEntry(key, values[random.nextInt(values.length)]);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class AllKeySetTest 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 IntIntMapTest method prepare.
@Prepare(global = false)
public void prepare() {
waitClusterSize(logger, targetInstance, minNumberOfMembers);
keys = generateIntKeys(keyCount, keyLocality, targetInstance);
Streamer<Integer, Integer> streamer = StreamerFactory.getInstance(map);
Random random = new Random();
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 StringICacheTest method prepare.
@Prepare
public void prepare() {
waitClusterSize(logger, targetInstance, minNumberOfMembers);
keys = generateStringKeys(keyCount, keyLength, keyLocality, targetInstance);
if (valueLength > -1) {
minValueLength = valueLength;
maxValueLength = valueLength;
}
values = generateStrings(valueCount, minValueLength, maxValueLength);
Random random = new Random();
Streamer<String, String> streamer = StreamerFactory.getInstance(cache);
for (String key : keys) {
String value = values[random.nextInt(valueCount)];
streamer.pushEntry(key, value);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class IntByteMapTest method prepare.
@Prepare
public void prepare() {
Random random = new Random();
values = new byte[valueCount][];
for (int i = 0; i < values.length; i++) {
int delta = maxSize - minSize;
int length = delta == 0 ? minSize : minSize + random.nextInt(delta);
values[i] = generateByteArray(random, length);
}
Streamer<Integer, Object> streamer = StreamerFactory.getInstance(map);
for (int key : keys) {
streamer.pushEntry(key, values[random.nextInt(values.length)]);
}
streamer.await();
}
Aggregations