|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.benchmark.byTask.tasks.PerfTask org.apache.lucene.benchmark.byTask.tasks.ReadTask
public abstract class ReadTask
Read index (abstract) task. Sub classes implement withSearch(), withWarm(), withTraverse() and withRetrieve() methods to configure the actual action.
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.
Field Summary |
---|
Fields inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask |
---|
logStep, NEW_LINE, params, stopNow |
Constructor Summary | |
---|---|
ReadTask(PerfRunData runData)
|
Method Summary | |
---|---|
protected Collector |
createCollector()
|
int |
doLogic()
Perform the task once (ignoring repetitions specification) Return number of work items done by this task. |
protected BenchmarkHighlighter |
getBenchmarkHighlighter(Query q)
Return an appropriate highlighter to be used with highlighting tasks |
protected Collection<String> |
getFieldsToHighlight(Document document)
Define the fields to highlight. |
abstract QueryMaker |
getQueryMaker()
Return query maker used for this task. |
protected Sort |
getSort()
|
int |
numHits()
Specify the number of hits to retrieve. |
int |
numToHighlight()
Set to the number of documents to highlight. |
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()
|
boolean |
withMaxScore()
Whether maxScores should be computed (only useful with field sort) |
abstract boolean |
withRetrieve()
Return true if, with search & results traversing, docs should be retrieved. |
boolean |
withScore()
Whether scores should be computed (only useful with field sort) |
abstract boolean |
withSearch()
Return true if search should be performed. |
abstract boolean |
withTraverse()
Return true if, with search, results should be traversed. |
abstract boolean |
withWarm()
Return true if warming should be performed. |
Methods inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask |
---|
clone, close, getBackgroundDeltaPriority, getDepth, getLogMessage, getName, getParams, getRunData, getRunInBackground, isDisableCounting, runAndMaybeStats, setDepth, setDisableCounting, setName, setParams, setRunInBackground, shouldNeverLogAtStart, shouldNotRecordStats, stopNow, supportsParams, tearDown, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReadTask(PerfRunData runData)
Method Detail |
---|
public int doLogic() throws Exception
PerfTask
doLogic
in class PerfTask
Exception
protected Collector createCollector() 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 withScore()
public boolean withMaxScore()
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
setup
in class PerfTask
Exception
public int numHits()
public abstract boolean withRetrieve()
public int numToHighlight()
protected BenchmarkHighlighter getBenchmarkHighlighter(Query q)
protected Sort getSort()
protected Collection<String> getFieldsToHighlight(Document document)
document
- The Document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |