Interface QueryManager

All Known Implementing Classes:
SqlQueryManager

public interface QueryManager
  • Method Details

    • getQueries

      List<BasicQueryInfo> getQueries()
    • setOutputInfoListener

      void setOutputInfoListener(QueryId queryId, Consumer<QueryExecution.QueryOutputInfo> listener) throws NoSuchElementException
      Add a listener that fires once the query output locations are known.
      Throws:
      NoSuchElementException - if query does not exist
    • outputTaskFailed

      void outputTaskFailed(TaskId taskId, Throwable failure)
      Notify that one of the output tasks failed for a given query
    • resultsConsumed

      void resultsConsumed(QueryId queryId)
      Notify that the query results for a query have been fully consumed by the client
    • 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
    • getQueryInfo

      BasicQueryInfo getQueryInfo(QueryId queryId) throws NoSuchElementException
      Throws:
      NoSuchElementException - if query does not exist
    • getFullQueryInfo

      QueryInfo getFullQueryInfo(QueryId queryId) throws NoSuchElementException
      Throws:
      NoSuchElementException - if query does not exist
    • getQuerySession

      Session getQuerySession(QueryId queryId)
      Throws:
      NoSuchElementException - if query does not exist
    • getQuerySlug

      Slug getQuerySlug(QueryId queryId)
      Throws:
      NoSuchElementException - if query does not exist
    • getQueryState

      QueryState getQueryState(QueryId queryId) throws NoSuchElementException
      Throws:
      NoSuchElementException - if query does not exist
    • hasQuery

      boolean hasQuery(QueryId queryId)
    • 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.