@Override
public void run() {
long start = System.nanoTime();
Session s = Factory.getSessionFullAccess();
Database db = s.getDatabase(server, dbPath);
DominoGraph graph = new DominoGraph(db);
for (int i = 1; i <= 10000; i++) {
Vertex v1 = graph.addVertex(null);
v1.setProperty("Test1", i);
Vertex v2 = graph.addVertex(null);
v2.setProperty("Test1", i);
graph.addEdge(null, v1, v2, "IAmInYou");
if (i % 1000 == 0) {
System.out.println("Iterated test " + i + " times. Committing...");
graph.commit();
}
}
graph.commit();
System.gc();
long elapsed = System.nanoTime() - start;
StringBuilder sb = new StringBuilder();
sb.append("Thread " + Thread.currentThread().getName());