Search in sources :

Example 1 with ShortestPathVertexProgram

use of org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgram in project janusgraph by JanusGraph.

the class VertexProgramScanJob method getQueries.

@Override
public void getQueries(QueryContainer queries) {
    Set<MessageScope> previousScopes = vertexMemory.getPreviousScopes();
    if (vertexProgram instanceof TraversalVertexProgram || vertexProgram instanceof ShortestPathVertexProgram || vertexProgram instanceof ConnectedComponentVertexProgram || previousScopes.contains(globalScope)) {
        // TraversalVertexProgram currently makes the assumption that the entire star-graph around a vertex
        // is available (in-memory). Hence, this special treatment here.
        // TODO: After TraversalVertexProgram is adjusted, remove this
        // Special handling for ShortestPathVertexProgram necessary until TINKERPOP-2187 is resolved
        // Apparently, ConnectedComponentVertexProgram also needs this special handling
        queries.addQuery().direction(Direction.BOTH).edges();
    }
    for (MessageScope scope : previousScopes) {
        if (scope instanceof MessageScope.Local) {
            JanusGraphVertexStep<Vertex> startStep = FulgoraUtil.getReverseJanusGraphVertexStep((MessageScope.Local) scope, queries.getTransaction());
            QueryContainer.QueryBuilder qb = queries.addQuery();
            startStep.makeQuery(qb);
            qb.edges();
        }
    }
}
Also used : ConnectedComponentVertexProgram(org.apache.tinkerpop.gremlin.process.computer.clustering.connected.ConnectedComponentVertexProgram) JanusGraphVertex(org.janusgraph.core.JanusGraphVertex) PreloadedVertex(org.janusgraph.graphdb.vertices.PreloadedVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) ShortestPathVertexProgram(org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgram) TraversalVertexProgram(org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram) MessageScope(org.apache.tinkerpop.gremlin.process.computer.MessageScope) QueryContainer(org.janusgraph.graphdb.olap.QueryContainer)

Aggregations

MessageScope (org.apache.tinkerpop.gremlin.process.computer.MessageScope)1 ConnectedComponentVertexProgram (org.apache.tinkerpop.gremlin.process.computer.clustering.connected.ConnectedComponentVertexProgram)1 ShortestPathVertexProgram (org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgram)1 TraversalVertexProgram (org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram)1 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)1 JanusGraphVertex (org.janusgraph.core.JanusGraphVertex)1 QueryContainer (org.janusgraph.graphdb.olap.QueryContainer)1 PreloadedVertex (org.janusgraph.graphdb.vertices.PreloadedVertex)1