ygerzhedovich commented on code in PR #4977:
URL: https://github.com/apache/ignite-3/pull/4977#discussion_r1900862992
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/QueryExecutor.java:
##########
@@ -360,4 +384,35 @@ public void stop() throws Exception {
runningQueries.values().forEach(query -> query.onError(ex));
}
+
+ private Event makeStartEvent(Query query) {
+ QueryInfo queryInfo = new QueryInfo(query);
+ Map<String, Object> fields = IgniteUtils.newLinkedHashMap(7);
+
+ fields.put("initiator", nodeId);
+ fields.put("id", queryInfo.id());
+ fields.put("schema", queryInfo.schema());
+ fields.put("sql", queryInfo.sql());
+ fields.put("parentId", queryInfo.parentId());
+ fields.put("statementNum", queryInfo.statementNum());
+ fields.put("transactionId", queryInfo.transactionId());
+
+ return IgniteEvents.QUERY_STARTED.builder()
+ .user(EventUser.system())
+ .timestamp(queryInfo.startTime().toEpochMilli())
+ .fields(fields)
+ .build();
+ }
+
+ private static Event makeFinishEvent(UUID queryId, @Nullable Throwable ex)
{
+ Map<String, Object> fields = IgniteUtils.newLinkedHashMap(2);
+
+ fields.put("id", queryId);
+ fields.put("error", ex == null ? null : unwrapCause(ex).getMessage());
+
+ return IgniteEvents.QUERY_FINISHED.builder()
Review Comment:
need to add timestamp of the event which helps to understand when the query
has been finished
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]