presto-main/src/main/java/io/prestosql/dispatcher/QueuedStatementResource.java/QueuedStatementResource/getNextUri
class QueuedStatementResource:        private URI getNextUri(long token, UriInfo uriInfo, String xForwardedProto, DispatchInfo dispatchInfo)
        {
            // if failed, query is complete
            if (dispatchInfo.getFailureInfo().isPresent()) {
                return null;
            }
            // if dispatched, redirect to new uri
            return dispatchInfo.getCoordinatorLocation()
                            .map(coordinatorLocation -> getRedirectUri(coordinatorLocation, uriInfo, xForwardedProto))
                            .orElseGet(() -> getQueuedUri(queryId, slug, token, uriInfo, xForwardedProto));
        }