mirror of https://github.com/apache/lucene.git
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:
parent
47a52d9f49
commit
9bec958bf0
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue