use of com.hazelcast.simulator.tests.map.domain.DomainObject in project hazelcast-simulator by hazelcast.
the class SerializationStrategyTest method createNewDomainObject.
private DomainObject createNewDomainObject(DomainObjectFactory objectFactory, String indexedField) {
DomainObject o = objectFactory.newInstance();
o.setKey(randomAlphanumeric(7));
o.setStringVal(indexedField);
o.setIntVal(nextInt(0, Integer.MAX_VALUE));
o.setLongVal(nextLong(0, Long.MAX_VALUE));
o.setDoubleVal(nextDouble(0.0, Double.MAX_VALUE));
return o;
}
use of com.hazelcast.simulator.tests.map.domain.DomainObject 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();
}
Aggregations