use of org.janusgraph.graphdb.util.ProfiledIterator in project janusgraph by JanusGraph.
the class JanusGraphStep method executeGraphCentricQuery.
private void executeGraphCentricQuery(final GraphCentricQueryBuilder builder, final List<Iterator<E>> responses, final Entry<Integer, GraphCentricQuery> entry) {
final GraphCentricQuery query = entry.getValue();
final QueryProfiler profiler = query.getProfiler();
final Class<? extends JanusGraphElement> graphClass = Vertex.class.isAssignableFrom(this.returnClass) ? JanusGraphVertex.class : JanusGraphEdge.class;
final ProfiledIterator iterator = new ProfiledIterator(profiler, () -> builder.iterables(query, graphClass).iterator());
long i = 0;
while (i < entry.getKey() && iterator.hasNext()) {
iterator.next();
i++;
}
responses.add(iterator);
}
Aggregations