use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class MapEntryListenerTest method globalPrepare.
@Prepare(global = true)
public void globalPrepare() {
EventCount initCounter = new EventCount();
for (int i = 0; i < keyCount; i++) {
map.put(i, values[i % valueLength]);
initCounter.addCount.getAndIncrement();
}
eventCounts.add(initCounter);
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class PagingPredicateTest method globalPrepare.
@Prepare(global = true)
public void globalPrepare() {
if (useIndex) {
map.addIndex("salary", true);
}
Streamer<Integer, Employee> streamer = StreamerFactory.getInstance(map);
for (int i = 0; i < keyCount; i++) {
Employee employee = new Employee(i);
streamer.pushEntry(employee.getId(), employee);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class SerializationStrategyTest method prepare.
@Prepare(global = true)
public void prepare() {
int uniqueStringsCount = itemCount / recordsPerUnique;
String[] strings = generateUniqueStrings(uniqueStringsCount);
Streamer<String, DomainObject> streamer = StreamerFactory.getInstance(map);
DomainObjectFactory objectFactory = DomainObjectFactory.newFactory(strategy);
for (int i = 0; i < itemCount; i++) {
String indexedField = strings[RandomUtils.nextInt(0, uniqueStringsCount)];
DomainObject o = createNewDomainObject(objectFactory, indexedField);
streamer.pushEntry(o.getKey(), o);
}
streamer.await();
}
use of com.hazelcast.simulator.test.annotations.Prepare in project hazelcast-simulator by hazelcast.
the class SlowOperationMapTest method localPrepare.
@Prepare
public void localPrepare() {
if (isClient) {
return;
}
Random random = new Random();
for (int key : keys) {
int value = random.nextInt(Integer.MAX_VALUE);
map.put(key, value);
}
}
Aggregations