|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
Other side effects: none.
Field Summary |
---|
Fields inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask |
---|
NEW_LINE, params |
Constructor Summary | |
---|---|
ReadTask(PerfRunData runData)
|
Method Summary | |
---|---|
protected int |
doHighlight(TokenStream ts,
String text,
Highlighter highlighter,
boolean mergeContiguous,
int maxFragments)
|
int |
doLogic()
Perform the task once (ignoring repetions specification) Return number of work items done by this task. |
protected Collection |
getFieldsToHighlight(Document document)
Define the fields to highlight. |
protected Highlighter |
getHighlighter(Query q)
|
abstract QueryMaker |
getQueryMaker()
Return query maker used for this task. |
protected Sort |
getSort()
|
boolean |
isMergeContiguousFragments()
|
int |
maxNumFragments()
|
int |
numToHighlight()
Set to the number of documents to highlight. |
protected Document |
retrieveDoc(IndexReader ir,
int id)
|
int |
traversalSize()
Specify the number of hits to traverse. |
abstract boolean |
withRetrieve()
Return true if, with search & results traversing, docs should be retrieved. |
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, getDepth, getName, getParams, getRunData, isDisableCounting, runAndMaybeStats, setDepth, setDisableCounting, setName, setParams, setup, shouldNeverLogAtStart, shouldNotRecordStats, 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 Document retrieveDoc(IndexReader ir, int id) throws IOException
IOException
public abstract QueryMaker getQueryMaker()
public abstract boolean withSearch()
public abstract boolean withWarm()
public abstract boolean withTraverse()
public int traversalSize()
withTraverse()
is true. Must be greater than 0.
Read task calculates the traversal as: Math.min(hits.length(), traversalSize())
public abstract boolean withRetrieve()
public int numToHighlight()
protected Highlighter getHighlighter(Query q)
public int maxNumFragments()
public boolean isMergeContiguousFragments()
protected int doHighlight(TokenStream ts, String text, Highlighter highlighter, boolean mergeContiguous, int maxFragments) throws IOException
IOException
protected Sort getSort()
protected Collection getFieldsToHighlight(Document document)
document
- The Document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |