use of com.hazelcast.simulator.tests.map.helpers.DataSerializableEmployee in project hazelcast-simulator by hazelcast.
the class SqlPredicateTest method prepare.
@Prepare(global = true)
public void prepare() {
Random random = new Random();
Streamer<String, DataSerializableEmployee> streamer = StreamerFactory.getInstance(map);
for (int i = 0; i < keyCount; i++) {
String key = generateString(keyLength);
DataSerializableEmployee value = generateRandomEmployee(random);
streamer.pushEntry(key, value);
}
streamer.await();
logger.info("Map size is: " + map.size());
logger.info("Map localKeySet size is: " + map.localKeySet().size());
}
use of com.hazelcast.simulator.tests.map.helpers.DataSerializableEmployee in project hazelcast-simulator by hazelcast.
the class SqlPredicateTest method generateRandomEmployee.
private DataSerializableEmployee generateRandomEmployee(Random random) {
int id = random.nextInt();
String name = NAMES[random.nextInt(NAMES.length)];
int age = random.nextInt(maxAge);
boolean active = random.nextBoolean();
double salary = random.nextDouble() * maxSalary;
return new DataSerializableEmployee(id, name, age, active, salary);
}
Aggregations