while (randomEdits.containsKey(random = randGen.nextInt(numEntries))) {
; // $codepro.audit.disable extraSemicolon
}
String name = "Feature." + random;
ObjectId newid = ObjectId.forString(name + "changed");
Node ref = Node.create(name, newid, ObjectId.NULL, TYPE.FEATURE, null);
randomEdits.put(random, ref);
}
RevTreeBuilder mutable = tree.builder(odb);
sw.reset().start();
for (Node ref : randomEdits.values()) {
mutable.put(ref);
}
mutable.build();
sw.stop();
System.err.println(randomEdits.size() + " random modifications in " + sw);
}
// CharSequence treeStr =
// repo.command(CatObject.class).setObject(Suppliers.ofInstance(tree))
// .call();
// System.out.println(treeStr);
final FindTreeChild childFinder = repo.command(FindTreeChild.class).setParent(tree);
sw.reset().start();
System.err.println("Reading " + numEntries + " entries....");
for (int i = 0; i < numEntries; i++) {
if ((i + 1) % (numEntries / 10) == 0) {
System.err.print("#" + (i + 1));
} else if ((i + 1) % (numEntries / 100) == 0) {
System.err.print('.');
}
String key = "Feature." + i;
// ObjectId oid = ObjectId.forString(key);
Optional<NodeRef> ref = childFinder.setChildPath(key).call();
assertTrue(key, ref.isPresent());
// assertEquals(key, ref.get().getPath());
// assertEquals(key, oid, ref.get().getObjectId());
}
sw.stop();
System.err.println("\nGot " + numEntries + " in " + sw.elapsed(TimeUnit.MILLISECONDS)