presto-main/src/main/java/io/prestosql/execution/SqlQueryManager.java/SqlQueryManager/getStateChange
class SqlQueryManager:    @Override
    public ListenableFuture<QueryState> getStateChange(QueryId queryId, QueryState currentState)
    {
        return queryTracker.tryGetQuery(queryId)
                .map(query -> query.getStateChange(currentState))
                .orElseGet(() -> immediateFailedFuture(new NoSuchElementException()));
    }