Interface QueryEngine

  • All Superinterfaces:
    java.lang.AutoCloseable

    public interface QueryEngine
    extends java.lang.AutoCloseable

    Interface for something that is able to execute and explain queries.

    Since:
    1.0
    Version:
    1.0
    Author:
    Michael Grove
    • Method Detail

      • close

        void close()
        Close this query engine and free up any resources it holds
        Specified by:
        close in interface java.lang.AutoCloseable
      • exec

        void exec​(@Nonnull
                  SelectQuery theQuery,
                  @Nonnull
                  SelectQueryResultHandler theHandler)
           throws MalformedQuery,
                  QueryExecutionFailure
        Execute the given query.
        Parameters:
        theQuery - the query to execute
        Throws:
        QueryExecutionFailure - if there is an error while executing the query
        MalformedQuery - The `Query` could be created such that it was not parsed initially and the executor will parse the query prior to execution
        Implementation Requirements:
        The query, if not already parsed, will first be parsed. Then the query will be executed, either synchronously or asynchronously, depending on the implementation of this `QueryEngine`. The results as they are computed will be forwarded to `theHandler`. Should any exception arise during execution it will be passed to `theErrorHandler` before execution is terminated; `theHandler` will receive no more results after `theErrorHandler` has been called.
      • explain

        @Nonnull
        QueryPlan explain​(@Nonnull
                          Query theQuery)
        Explain the given query
        Parameters:
        theQuery - the query to explain
        Returns:
        the query plan
        Throws:
        MalformedQuery - The `Query` could be created such that it was not parsed initially and the executor will parse the query prior to retrieving the plan