LUCENE-2044: add delete.percent.rand.seed to control random seed for DeleteByPercentTask

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@833861 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-11-08 11:54:35 +00:00
parent 47a52d9f49
commit 9bec958bf0
2 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,10 @@ The Benchmark contrib package contains code for benchmarking Lucene in a variety
$Id:$
11/08/2009
LUCENE-2044: Added delete.percent.rand.seed to seed the Random instance
used by DeleteByPercentTask. (Mike McCandless)
11/07/2009
LUCENE-2043: Fix CommitIndexTask to also commit pending IndexReader
changes (Mike McCandless)

View File

@ -32,14 +32,21 @@ import org.apache.lucene.index.TermDocs;
* <p><b>NOTE</b>: the param is an absolute percentage of
* maxDoc(). This means if you delete 50%, and then delete
* 50% again, the 2nd delete will do nothing.
*
* <p> Parameters:
* <ul>
* <li> delete.percent.rand.seed - defines the seed to
* initialize Random (default 1717)
* </ul>
*/
public class DeleteByPercentTask extends PerfTask {
double percent;
int numDeleted = 0;
Random random = new Random(System.currentTimeMillis());
final Random random;
public DeleteByPercentTask(PerfRunData runData) {
super(runData);
random = new Random(runData.getConfig().get("delete.percent.rand.seed", 1717));
}
public void setup() throws Exception {