Package org.apache.solr.search
Class CallerSpecificQueryLimit
java.lang.Object
org.apache.solr.search.CallerSpecificQueryLimit
- All Implemented Interfaces:
org.apache.lucene.index.QueryTimeout,org.apache.solr.search.QueryLimit
Helper class to simulate query timeouts at specific points in various components that call
QueryLimits.shouldExit(). These calling points are identified by the calling class' simple name
and optionally a method name and the optional maximum count, e.g. MoreLikeThisComponent
or
ClusteringComponent.finishStage, ClusteringComponent.finishStage:100.
NOTE: implementation details cause the expression simpleName to be disabled when
also any simpleName.anyMethod[:NNN] expression is used for the same class name.
NOTE 2: when maximum count is a negative number e.g. simpleName.someMethod:-1
then only the number of calls to QueryLimits.shouldExit() for that expression will be
reported but no limit will be enforced.
-
Constructor Summary
ConstructorsConstructorDescriptionCallerSpecificQueryLimit(String... callerExprs) Signal a timeout in places that match the calling classes (and methods).CallerSpecificQueryLimit(Collection<String> callerExprs) -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of tripped caller expressions to their current call counts.Returns the set of caller expressions that were tripped.boolean
-
Constructor Details
-
CallerSpecificQueryLimit
Signal a timeout in places that match the calling classes (and methods).- Parameters:
callerExprs- list of expressions in the format ofsimpleClassName[.methodName][:NNN]. If the list is empty or null then the first call toshouldExit()from any caller will match.
-
CallerSpecificQueryLimit
-
-
Method Details
-
getTrippedBy
Returns the set of caller expressions that were tripped. -
getCallCounts
Returns a map of tripped caller expressions to their current call counts. -
shouldExit
public boolean shouldExit()- Specified by:
shouldExitin interfaceorg.apache.lucene.index.QueryTimeout
-
currentValue
- Specified by:
currentValuein interfaceorg.apache.solr.search.QueryLimit
-