org.apache.lucene.benchmark.byTask.tasks

Class ReadTask

public abstract class ReadTask extends PerfTask

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.

Constructor Summary
ReadTask(PerfRunData runData)
Method Summary
intdoLogic()
abstract QueryMakergetQueryMaker()
Return query maker used for this task.
protected intretrieveDoc(IndexReader ir, int id)
inttraversalSize()
Specify the number of hits to traverse.
abstract booleanwithRetrieve()
Return true if, with search & results traversing, docs should be retrieved.
abstract booleanwithSearch()
Return true if search should be performed.
abstract booleanwithTraverse()
Return true if, with search, results should be traversed.
abstract booleanwithWarm()
Return true if warming should be performed.

Constructor Detail

ReadTask

public ReadTask(PerfRunData runData)

Method Detail

doLogic

public int doLogic()

getQueryMaker

public abstract QueryMaker getQueryMaker()
Return query maker used for this task.

retrieveDoc

protected int retrieveDoc(IndexReader ir, int id)

traversalSize

public int traversalSize()
Specify the number of hits to traverse. Tasks should override this if they want to restrict the number of hits that are traversed when withTraverse is true. Must be greater than 0. Read task calculates the traversal as: Math.min(hits.length(), traversalSize())

Returns: Integer.MAX_VALUE

withRetrieve

public abstract boolean withRetrieve()
Return true if, with search & results traversing, docs should be retrieved.

withSearch

public abstract boolean withSearch()
Return true if search should be performed.

withTraverse

public abstract boolean withTraverse()
Return true if, with search, results should be traversed.

withWarm

public abstract boolean withWarm()
Return true if warming should be performed.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.