Package org.apache.solr.search
Class TimeAllowedLimit
- java.lang.Object
-
- org.apache.solr.search.TimeAllowedLimit
-
- All Implemented Interfaces:
org.apache.lucene.index.QueryTimeout
public class TimeAllowedLimit extends Object implements org.apache.lucene.index.QueryTimeout
Enforces a wall clock based timeout on a given SolrQueryRequest. This class holds the logic for thetimeAllowed
query parameter. Note that timeAllowed will be ignored for local processing of sub-queries in cases where the parent query already hastimeAllowed
set. Essentially only one timeAllowed can be specified for any thread executing a query. This is to ensure that subqueries don't escape from the intended limit
-
-
Constructor Summary
Constructors Constructor Description TimeAllowedLimit(SolrQueryRequest req)
Create an object to represent a time limit for the current request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldExit()
Return true if a max limit value is set and the current usage has exceeded the limit.
-
-
-
Constructor Detail
-
TimeAllowedLimit
public TimeAllowedLimit(SolrQueryRequest req)
Create an object to represent a time limit for the current request.- Parameters:
req
- A solr request that has a value fortimeAllowed
- Throws:
IllegalArgumentException
- if the request does not contain timeAllowed parameter. This should be validated withhasTimeLimit(SolrQueryRequest)
prior to constructing this object
-
-