use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class LongExternalizableCacheTest method prepare.
@Prepare(global = true)
public void prepare() {
Streamer<Long, ExternalizablePojo> streamer = StreamerFactory.getInstance(cache);
for (long key = 0; key < keyDomain; key++) {
streamer.pushEntry(key, new ExternalizablePojo());
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class MapTxTest method prepare.
@Prepare
public void prepare() {
keys = generateIntKeys(keyCount, keyLocality, targetInstance);
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, byte[]> streamer = StreamerFactory.getInstance(map);
for (int key : keys) {
byte[] 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 LockTest method prepare.
@Prepare(global = true)
public void prepare() {
for (int i = 0; i < lockCount; i++) {
long key = lockCounter.getAndIncrement();
targetInstance.getLock(getLockId(key));
IAtomicLong account = targetInstance.getAtomicLong(getAccountId(key));
account.set(initialAmount);
}
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class LongStringCacheTest method prepare.
@Prepare(global = true)
public void prepare() {
Random random = new Random();
for (long key = 0; key < keyDomain; key++) {
String value = values[random.nextInt(valueCount)];
cache.put(key, value);
}
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class LongStringCacheTest method prepare.
@Prepare(global = true)
public void prepare() {
Random random = new Random();
for (long key = 0; key < keyDomain; key++) {
String value = values[random.nextInt(valueCount)];
cache.put(key, value);
}
}
Aggregations