use of com.alibaba.maxgraph.logging.LogEvents.QueryType in project GraphScope by alibaba.
the class MixedOpProcessor method processGraphTraversal.
@Override
protected void processGraphTraversal(String script, Context context, Object traversal, long timeout) {
String queryId = String.valueOf(ThreadLocalRandom.current().nextLong());
Stopwatch timer = Stopwatch.createStarted();
QueryType queryType = QueryType.EXECUTE;
if (traversal instanceof PreparedTraversal) {
queryType = QueryType.PREPARE;
} else if (traversal instanceof PreparedExecuteParam) {
queryType = QueryType.QUERY;
}
Logging.query(this.graphName, com.alibaba.maxgraph.proto.RoleType.FRONTEND, this.serverId, queryId, queryType, QueryEvent.FRONT_RECEIVED, null, null, null, script);
try {
Long totalResultNum = doProcessGraphTraversal(script, context, traversal, timeout, queryId, timer);
Logging.query(this.graphName, com.alibaba.maxgraph.proto.RoleType.FRONTEND, this.serverId, queryId, QueryType.EXECUTE, QueryEvent.FRONT_FINISH, timer.elapsed(TimeUnit.NANOSECONDS), totalResultNum, true, script);
} catch (Exception e) {
Logging.query(this.graphName, com.alibaba.maxgraph.proto.RoleType.FRONTEND, this.serverId, queryId, QueryType.EXECUTE, QueryEvent.FRONT_FINISH, timer.elapsed(TimeUnit.NANOSECONDS), null, false, script);
throw new RuntimeException(e);
}
}
Aggregations