TimeLimitingCollector
instead, which extends the new
Collector
. This class will be removed in 3.0.public class TimeLimitedCollector extends HitCollector
The TimeLimitedCollector is used to timeout search requests that take longer than the maximum allowed search time limit. After this time is exceeded, the search thread is stopped by throwing a TimeExceeded Exception.
Modifier and Type | Class and Description |
---|---|
static class |
TimeLimitedCollector.TimeExceededException
Deprecated.
Thrown when elapsed search time exceeds allowed search time.
|
Modifier and Type | Field and Description |
---|---|
boolean |
DEFAULT_GREEDY
Deprecated.
Default for
isGreedy() . |
static int |
DEFAULT_RESOLUTION
Deprecated.
Default timer resolution.
|
Constructor and Description |
---|
TimeLimitedCollector(HitCollector hc,
long timeAllowed)
Deprecated.
Create a TimeLimitedCollector wrapper over another HitCollector with a specified timeout.
|
Modifier and Type | Method and Description |
---|---|
void |
collect(int doc,
float score)
Deprecated.
Calls collect() on the decorated HitCollector.
|
static long |
getResolution()
Deprecated.
Return the timer resolution.
|
boolean |
isGreedy()
Deprecated.
Checks if this time limited collector is greedy in collecting the last hit.
|
void |
setGreedy(boolean greedy)
Deprecated.
Sets whether this time limited collector is greedy.
|
static void |
setResolution(long newResolution)
Deprecated.
Set the timer resolution.
|
public static final int DEFAULT_RESOLUTION
setResolution(long)
,
Constant Field Valuespublic boolean DEFAULT_GREEDY
isGreedy()
.isGreedy()
public TimeLimitedCollector(HitCollector hc, long timeAllowed)
hc
- the wrapped HitCollectortimeAllowed
- max time allowed for collecting hits after which TimeLimitedCollector.TimeExceededException
is thrownpublic void collect(int doc, float score)
collect
in class HitCollector
TimeLimitedCollector.TimeExceededException
- if the time allowed has been exceeded.public static long getResolution()
setResolution(long)
public static void setResolution(long newResolution)
public boolean isGreedy()
TimeLimitedCollector.TimeExceededException
without allowing the wrapped collector to collect current doc. A greedy one would
first allow the wrapped hit collector to collect current doc and only then
throw a TimeLimitedCollector.TimeExceededException
.setGreedy(boolean)
public void setGreedy(boolean greedy)
greedy
- true to make this time limited greedyisGreedy()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.