Search in sources :

Example 1 with TitanVertexQuery

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();
}
Also used : TitanVertex(com.thinkaurelius.titan.core.TitanVertex) Vertex(com.tinkerpop.blueprints.Vertex) TitanVertex(com.thinkaurelius.titan.core.TitanVertex) TitanVertexQuery(com.thinkaurelius.titan.core.TitanVertexQuery) VertexList(com.thinkaurelius.titan.core.VertexList)

Aggregations

TitanVertex (com.thinkaurelius.titan.core.TitanVertex)1 TitanVertexQuery (com.thinkaurelius.titan.core.TitanVertexQuery)1 VertexList (com.thinkaurelius.titan.core.VertexList)1 Vertex (com.tinkerpop.blueprints.Vertex)1