use of org.neo4j.graphdb.QueryExecutionType in project neo4j by neo4j.
the class CypherAdapterStream method accept.
@Override
public void accept(final Visitor visitor) throws Exception {
long start = clock.millis();
delegate.accept(row -> {
visitor.visit(currentRecord.reset(row));
return true;
});
visitor.addMetadata("result_consumed_after", clock.millis() - start);
QueryExecutionType qt = delegate.getQueryExecutionType();
visitor.addMetadata("type", queryTypeCode(qt.queryType()));
if (delegate.getQueryStatistics().containsUpdates()) {
Object stats = queryStats(delegate.getQueryStatistics());
visitor.addMetadata("stats", stats);
}
if (qt.requestedExecutionPlanDescription()) {
ExecutionPlanDescription rootPlanTreeNode = delegate.getExecutionPlanDescription();
String metadataFieldName = rootPlanTreeNode.hasProfilerStatistics() ? "profile" : "plan";
visitor.addMetadata(metadataFieldName, ExecutionPlanConverter.convert(rootPlanTreeNode));
}
Iterable<Notification> notifications = delegate.getNotifications();
if (notifications.iterator().hasNext()) {
visitor.addMetadata("notifications", NotificationConverter.convert(notifications));
}
}
Aggregations