Interface QueryBackend<T extends GeneratedQueryContext>

Type Parameters:
T - the type of the generated query

public interface QueryBackend<T extends GeneratedQueryContext>
A search backend that is capable of generating and executing search jobs
  • Method Details

    • generate

      T generate(Query query, Set<SearchError> validationErrors)
      Generate a backend-specific query out of the logical query structure.
      Parameters:
      query - the graylog query structure
      Returns:
      a backend specific generated query
    • isAllMessages

      default boolean isAllMessages(TimeRange timeRange)
    • effectiveTimeRangeForResult

      default AbsoluteRange effectiveTimeRangeForResult(Query query, QueryResult queryResult)
    • run

      default QueryResult run(SearchJob job, Query query, GeneratedQueryContext generatedQueryContext)
    • doRun

      QueryResult doRun(SearchJob job, Query query, T queryContext)
      Run the generated query as part of the given query job.

      This method is typically being run in an executor and can safely block.

      Parameters:
      job - currently executing job
      query - the individual query to run from the current job
      queryContext - the generated query by )
      Returns:
      the result for the query
      Throws:
      RuntimeException - if the query could not be executed for some reason
    • isSearchTypeWithError

      default boolean isSearchTypeWithError(T queryContext, String searchTypeId)