org.apache.lucene.benchmark.byTask.tasks

Class TaskSequence

Implemented Interfaces:
Cloneable

public class TaskSequence
extends PerfTask

Sequence of parallel or sequential tasks.

Field Summary

Fields inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask

NEW_LINE, params

Constructor Summary

TaskSequence(PerfRunData runData, String name, TaskSequence parent, boolean parallel)

Method Summary

void
addTask(PerfTask task)
protected Object
clone()
int
doLogic()
Perform the task once (ignoring repetions specification) Return number of work items done by this task.
String
getName()
TaskSequence
getParent()
int
getRate()
Returns the rate per minute: how many operations should be performed in a minute.
int
getRepetitions()
ArrayList
getTasks()
boolean
isParallel()
void
setNoChildReport()
Execute child tasks in a way that they do not reprt their time separately.
void
setRate(int rate, boolean perMin)
void
setRepetitions(int repetitions)
String
toString()

Methods inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask

clone, doLogic, getDepth, getName, getParams, getRunData, runAndMaybeStats, setDepth, setName, setParams, setup, shouldNeverLogAtStart, shouldNotRecordStats, tearDown, toString

Constructor Details

TaskSequence

public TaskSequence(PerfRunData runData,
                    String name,
                    TaskSequence parent,
                    boolean parallel)

Method Details

addTask

public void addTask(PerfTask task)

clone

protected Object clone()
            throws CloneNotSupportedException
Overrides:
clone in interface PerfTask

doLogic

public int doLogic()
            throws Exception
Perform the task once (ignoring repetions specification) Return number of work items done by this task. For indexing that can be number of docs added. For warming that can be number of scanned items, etc.
Overrides:
doLogic in interface PerfTask
Returns:
number of work items done by this task.

getName

public String getName()
Overrides:
getName in interface PerfTask
Returns:
Returns the name.

getParent

public TaskSequence getParent()
Returns:
Returns the parent.

getRate

public int getRate()
Returns the rate per minute: how many operations should be performed in a minute. If 0 this has no effect.
Returns:
the rate per min: how many operations should be performed in a minute.

getRepetitions

public int getRepetitions()
Returns:
Returns the repetitions.

getTasks

public ArrayList getTasks()
Returns:
Returns the tasks.

isParallel

public boolean isParallel()
Returns:
Returns the parallel.

setNoChildReport

public void setNoChildReport()
Execute child tasks in a way that they do not reprt their time separately. Current implementation if child tasks has child tasks of their own, those are not affected by this call.

setRate

public void setRate(int rate,
                    boolean perMin)
Parameters:
rate - The rate to set.

setRepetitions

public void setRepetitions(int repetitions)
Parameters:
repetitions - The repetitions to set.

toString

public String toString()
Overrides:
toString in interface PerfTask

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.