Interface QueryManager

  • All Known Implementing Classes:
    SqlQueryManager

    public interface QueryManager
    • Method Detail

      • addStateChangeListener

        void addStateChangeListener​(QueryId queryId,
                                    StateMachine.StateChangeListener<QueryState> listener)
                             throws NoSuchElementException
        Add a listener that fires each time the query state changes. Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leaking this when adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution.
        Throws:
        NoSuchElementException - if query does not exist
      • getStateChange

        com.google.common.util.concurrent.ListenableFuture<QueryState> getStateChange​(QueryId queryId,
                                                                                      QueryState currentState)
        Gets a future that completes when the query changes from the specified current state or immediately if the query is already in a final state. If the query does not exist, the future will contain a NoSuchElementException
      • recordHeartbeat

        void recordHeartbeat​(QueryId queryId)
        Updates the client heartbeat time, to prevent the query from be automatically purged. If the query does not exist, the call is ignored.
      • createQuery

        void createQuery​(QueryExecution execution)
        Creates a new query using the specified query execution.
      • failQuery

        void failQuery​(QueryId queryId,
                       Throwable cause)
        Attempts to fail the query for the specified reason. If the query is already in a final state, the call is ignored. If the query does not exist, the call is ignored.
      • cancelQuery

        void cancelQuery​(QueryId queryId)
        Attempts to fail the query due to a user cancellation. If the query is already in a final state, the call is ignored. If the query does not exist, the call is ignored.
      • cancelStage

        void cancelStage​(StageId stageId)
        Attempts to cancel the stage and continue the query. If the stage is already in a final state, the call is ignored. If the query does not exist, the call is ignored.