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 Summary
Modifier and TypeMethodDescriptionRun the generated query as part of the given query job.default AbsoluteRange
effectiveTimeRangeForResult
(Query query, QueryResult queryResult) generate
(Query query, Set<SearchError> validationErrors) Generate a backend-specific query out of the logical query structure.default boolean
isAllMessages
(TimeRange timeRange) default boolean
isSearchTypeWithError
(T queryContext, String searchTypeId) default QueryResult
run
(SearchJob job, Query query, GeneratedQueryContext generatedQueryContext)
-
Method Details
-
generate
Generate a backend-specific query out of the logical query structure.- Parameters:
query
- the graylog query structure- Returns:
- a backend specific generated query
-
isAllMessages
-
effectiveTimeRangeForResult
-
run
-
doRun
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 jobquery
- the individual query to run from the current jobqueryContext
- the generated query by) - Returns:
- the result for the query
- Throws:
RuntimeException
- if the query could not be executed for some reason
-
isSearchTypeWithError
-