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 | Field and Description |
---|---|
static ThreadLocal<Long> |
timeoutAt
The ThreadLocal variable to store the time beyond which, the processing should exit.
|
Modifier and Type | Method and Description |
---|---|
static Long |
get()
Get the current value of timeoutAt.
|
static SolrQueryTimeoutImpl |
getInstance()
Return singleton instance
|
boolean |
isTimeoutEnabled() |
static void |
reset()
Cleanup the ThreadLocal timeout value.
|
static void |
set(Long timeAllowed)
Method to set the time at which the timeOut should happen.
|
boolean |
shouldExit()
Return true if a timeoutAt value is set and the current time has exceeded the set timeOut.
|
String |
toString() |
public static ThreadLocal<Long> timeoutAt
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(Long timeAllowed)
timeAllowed
- set the time at which this thread should timeout.public static void reset()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.