public class SolrQueryTimeoutImpl extends Object implements QueryTimeout
QueryTimeout
that is used by Solr.
It uses a ThreadLocal variable to track the timeoutAt value
for each request thread.Modifier and Type | Method and Description |
---|---|
static Long |
get()
The time (nanoseconds) at which the request should be considered timed out.
|
static SolrQueryTimeoutImpl |
getInstance()
Return singleton instance
|
boolean |
isTimeoutEnabled() |
static void |
reset()
Cleanup the ThreadLocal timeout value.
|
static void |
set(Long timeAllowed)
Sets the time allowed (milliseconds), assuming we start a timer immediately.
|
static void |
set(SolrQueryRequest req)
Sets or clears the time allowed based on how much time remains from the start of the request plus the configured
CommonParams.TIME_ALLOWED . |
boolean |
shouldExit()
Return true if a timeoutAt value is set and the current time has exceeded the set timeOut.
|
String |
toString() |
public static SolrQueryTimeoutImpl getInstance()
public static Long get()
public boolean isTimeoutEnabled()
isTimeoutEnabled
in interface QueryTimeout
public boolean shouldExit()
shouldExit
in interface QueryTimeout
public static void set(SolrQueryRequest req)
CommonParams.TIME_ALLOWED
.public static void set(Long timeAllowed)
set(SolrQueryRequest)
instead.public static void reset()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.