public abstract class ReadTask extends PerfTask
Note: All ReadTasks reuse the reader if it is already open. Otherwise a reader is opened at start and closed at the end.
The search.num.hits
config parameter sets
the top number of hits to collect during searching. If
print.hits.field
is set, then each hit is
printed along with the value of that field.
Other side effects: none.
Constructor and Description |
---|
ReadTask(PerfRunData runData) |
Modifier and Type | Method and Description |
---|---|
protected Collector |
createCollector() |
int |
doLogic()
Perform the task once (ignoring repetitions specification)
Return number of work items done by this task.
|
abstract QueryMaker |
getQueryMaker()
Return query maker used for this task.
|
protected Sort |
getSort() |
int |
numHits()
Specify the number of hits to retrieve.
|
protected Document |
retrieveDoc(IndexReader ir,
int id) |
void |
setup()
Task setup work that should not be measured for that specific task.
|
int |
traversalSize()
Specify the number of hits to traverse.
|
boolean |
withCollector() |
abstract boolean |
withRetrieve()
Return true if, with search and results traversing, docs should be retrieved.
|
abstract boolean |
withSearch()
Return true if search should be performed.
|
protected int |
withTopDocs(IndexSearcher searcher,
Query q,
TopDocs hits) |
boolean |
withTotalHits()
Whether totalHits should be computed (only useful with
field sort)
|
abstract boolean |
withTraverse()
Return true if, with search, results should be traversed.
|
abstract boolean |
withWarm()
Return true if warming should be performed.
|
clone, close, getAlgLineNum, getBackgroundDeltaPriority, getDepth, getLogMessage, getName, getParams, getRunData, getRunInBackground, isDisableCounting, runAndMaybeStats, setAlgLineNum, setDepth, setDisableCounting, setName, setParams, setRunInBackground, shouldNeverLogAtStart, shouldNotRecordStats, stopNow, supportsParams, tearDown, toString
public ReadTask(PerfRunData runData)
public int doLogic() throws Exception
PerfTask
protected int withTopDocs(IndexSearcher searcher, Query q, TopDocs hits) throws Exception
Exception
protected Document retrieveDoc(IndexReader ir, int id) throws IOException
IOException
public abstract QueryMaker getQueryMaker()
public abstract boolean withSearch()
public boolean withCollector()
public abstract boolean withWarm()
public abstract boolean withTraverse()
public boolean withTotalHits()
public int traversalSize()
withTraverse()
is true. Must be greater than 0.
Read task calculates the traversal as: Math.min(hits.length(), traversalSize())
public void setup() throws Exception
PerfTask
PerfTask.doLogic()
to this method. Only the work done in PerfTask.doLogic()
is measured for this task. Notice that higher level (sequence) tasks
containing this task would then measure larger time than the sum of their
contained tasks.public int numHits()
public abstract boolean withRetrieve()
protected Sort getSort()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.