ExecutorService executor = Executors.newFixedThreadPool(numberOfMks);
for (int i = 0; i < numberOfMks; i++) {
String diff = buildPyramidDiff("/", 0, numberOfChildren,
numberOfNodes, prefixes[i], new StringBuilder()).toString();
MongoMK mk = new MongoMK.Builder().open();
GenericWriteTask task = new GenericWriteTask("mk-" + i, mk, diff, 10);
executor.execute(task);
}
executor.shutdown();
executor.awaitTermination(10, TimeUnit.MINUTES);