use of com.thinkaurelius.titan.core.TitanVertexQuery in project titan by thinkaurelius.
the class SpeedComparisonPerformanceTest method retrieveNgh.
public void retrieveNgh(boolean inMemory) {
long time = time();
Vertex[] vertices = new TitanVertex[numVertices];
for (int i = 0; i < numVertices; i++) vertices[i] = graph.getVertices("uid", i).iterator().next();
time = time() - time;
for (int t = 0; t < 4; t++) {
time = time();
for (int i = 0; i < numVertices; i++) {
TitanVertexQuery q = ((TitanVertexQuery) vertices[i].query()).direction(Direction.OUT).labels("connect");
if (inMemory) {
// TODO: this has been disabled
for (Vertex v : q.vertices()) {
v.getId();
}
} else {
VertexList vl = q.vertexIds();
for (int j = 0; j < vl.size(); j++) {
vl.get(j);
}
}
}
time = time() - time;
System.out.println("Ngh retrieval: " + time);
}
graph.commit();
}
Aggregations