use of org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram 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();
}
}
}
use of org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram in project titan by thinkaurelius.
the class VertexProgramScanJob method getQueries.
@Override
public void getQueries(QueryContainer queries) {
if (vertexProgram instanceof TraversalVertexProgram) {
//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
queries.addQuery().direction(Direction.BOTH).edges();
return;
}
for (MessageScope scope : vertexMemory.getPreviousScopes()) {
if (scope instanceof MessageScope.Global) {
queries.addQuery().direction(Direction.BOTH).edges();
} else {
assert scope instanceof MessageScope.Local;
TitanVertexStep<Vertex> startStep = FulgoraUtil.getReverseTitanVertexStep((MessageScope.Local) scope, queries.getTransaction());
QueryContainer.QueryBuilder qb = queries.addQuery();
startStep.makeQuery(qb);
qb.edges();
}
}
}
Aggregations