use of jetbrains.exodus.util.Random in project xodus by JetBrains.
the class StressTests method xd_347_like.
static void xd_347_like(PersistentEntityStoreImpl store, int count) {
final List<Entity> issues = store.computeInTransaction(txn -> {
final List<Entity> result = new ArrayList<>();
for (final Entity issue : txn.getAll("Issue")) {
result.add(issue);
}
while (result.size() < 10000) {
result.add(txn.newEntity("Issue"));
}
return result;
});
final Random rnd = new Random(346);
for (int i = 0; i < count; ++i) {
store.executeInTransaction(txn -> {
for (int j = 0; j < 100; ++j) {
issues.get(rnd.nextInt(issues.size())).setProperty("created", System.currentTimeMillis());
issues.get(rnd.nextInt(issues.size())).setProperty("updated", System.currentTimeMillis());
}
});
if (i % 10 == 0) {
logger.info((i * 100 / count) + "%\r");
}
}
}
Aggregations