Search in sources :

Example 1 with CountGlobalStep

use of org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep in project janusgraph by JanusGraph.

the class JanusGraphStep method buildGraphCentricQuery.

private GraphCentricQuery buildGraphCentricQuery(JanusGraphQuery query, final QueryProfiler queryProfiler) {
    Preconditions.checkArgument(query instanceof GraphCentricQueryBuilder);
    final QueryProfiler optProfiler = queryProfiler.addNested(QueryProfiler.CONSTRUCT_GRAPH_CENTRIC_QUERY);
    optProfiler.startTimer();
    final GraphCentricQueryBuilder centricQueryBuilder = ((GraphCentricQueryBuilder) query);
    if (traversal.getEndStep() instanceof CountGlobalStep) {
        centricQueryBuilder.disableSmartLimit();
    }
    final GraphCentricQuery graphCentricQuery = centricQueryBuilder.constructQueryWithoutProfile(Vertex.class.isAssignableFrom(this.returnClass) ? ElementCategory.VERTEX : ElementCategory.EDGE);
    optProfiler.stopTimer();
    return graphCentricQuery;
}
Also used : GraphCentricQueryBuilder(org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder) GraphCentricQuery(org.janusgraph.graphdb.query.graph.GraphCentricQuery) QueryProfiler(org.janusgraph.graphdb.query.profile.QueryProfiler) CountGlobalStep(org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep)

Aggregations

CountGlobalStep (org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep)1 GraphCentricQuery (org.janusgraph.graphdb.query.graph.GraphCentricQuery)1 GraphCentricQueryBuilder (org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder)1 QueryProfiler (org.janusgraph.graphdb.query.profile.QueryProfiler)1