Search in sources :

Example 1 with DomainObjectFactory

use of com.hazelcast.simulator.tests.map.domain.DomainObjectFactory 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();
}
Also used : DomainObjectFactory(com.hazelcast.simulator.tests.map.domain.DomainObjectFactory) DomainObject(com.hazelcast.simulator.tests.map.domain.DomainObject) Prepare(com.hazelcast.simulator.test.annotations.Prepare)

Aggregations

Prepare (com.hazelcast.simulator.test.annotations.Prepare)1 DomainObject (com.hazelcast.simulator.tests.map.domain.DomainObject)1 DomainObjectFactory (com.hazelcast.simulator.tests.map.domain.DomainObjectFactory)1