"Adding a total of {} nodes evely spread across cluster. Loop: {}, Count: {}, Cluster nodes: {}",
new Object[] { loop * count * clusters, loop, count, clusters });
// creating instances
for (int i = 1; i <= clusters; i++) {
DocumentMK mk = new DocumentMK.Builder()
.setMongoDB(createConnection().getDB())
.setClusterId(i).open();
mks.add(mk);
}
Map<String, Exception> exceptions = Collections.synchronizedMap(
new HashMap<String, Exception>());
// initialising repositories and creating workers
for (int i = 0; i < mks.size(); i++) {
DocumentMK mk = mks.get(i);
Repository repo = new Jcr(mk.getNodeStore()).createRepository();
Session session = repo.login(ADMIN);
ensureIndex(session);
session.logout();
repos.add(repo);
workers.add(new Thread(new Worker(repo, exceptions), "Worker-" + (i + 1)));