Search in sources :

Example 1 with QueryMetadata

use of io.trino.spi.eventlistener.QueryMetadata in project trino by trinodb.

the class QueryMonitor method queryImmediateFailureEvent.

public void queryImmediateFailureEvent(BasicQueryInfo queryInfo, ExecutionFailureInfo failure) {
    eventListenerManager.queryCompleted(new QueryCompletedEvent(new QueryMetadata(queryInfo.getQueryId().toString(), queryInfo.getSession().getTransactionId().map(TransactionId::toString), queryInfo.getQuery(), queryInfo.getUpdateType(), queryInfo.getPreparedQuery(), queryInfo.getState().toString(), ImmutableList.of(), ImmutableList.of(), queryInfo.getSelf(), Optional.empty(), Optional.empty()), new QueryStatistics(ofMillis(0), ofMillis(0), ofMillis(0), ofMillis(queryInfo.getQueryStats().getQueuedTime().toMillis()), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ImmutableList.of(), 0, true, ImmutableList.of(), ImmutableList.of(), Optional.empty()), createQueryContext(queryInfo.getSession(), queryInfo.getResourceGroupId(), queryInfo.getQueryType()), new QueryIOMetadata(ImmutableList.of(), Optional.empty()), createQueryFailureInfo(failure, Optional.empty()), ImmutableList.of(), ofEpochMilli(queryInfo.getQueryStats().getCreateTime().getMillis()), ofEpochMilli(queryInfo.getQueryStats().getEndTime().getMillis()), ofEpochMilli(queryInfo.getQueryStats().getEndTime().getMillis())));
    logQueryTimeline(queryInfo);
}
Also used : QueryMetadata(io.trino.spi.eventlistener.QueryMetadata) QueryCompletedEvent(io.trino.spi.eventlistener.QueryCompletedEvent) QueryStatistics(io.trino.spi.eventlistener.QueryStatistics) QueryIOMetadata(io.trino.spi.eventlistener.QueryIOMetadata)

Aggregations

QueryCompletedEvent (io.trino.spi.eventlistener.QueryCompletedEvent)1 QueryIOMetadata (io.trino.spi.eventlistener.QueryIOMetadata)1 QueryMetadata (io.trino.spi.eventlistener.QueryMetadata)1 QueryStatistics (io.trino.spi.eventlistener.QueryStatistics)1