lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r833861 - in /lucene/java/trunk/contrib/benchmark: CHANGES.txt src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
Date Sun, 08 Nov 2009 11:54:35 GMT
Author: mikemccand
Date: Sun Nov  8 11:54:35 2009
New Revision: 833861

URL: http://svn.apache.org/viewvc?rev=833861&view=rev
Log:
LUCENE-2044: add delete.percent.rand.seed to control random seed for DeleteByPercentTask

Modified:
    lucene/java/trunk/contrib/benchmark/CHANGES.txt
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java

Modified: lucene/java/trunk/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/CHANGES.txt?rev=833861&r1=833860&r2=833861&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/CHANGES.txt (original)
+++ lucene/java/trunk/contrib/benchmark/CHANGES.txt Sun Nov  8 11:54:35 2009
@@ -4,6 +4,10 @@
 
 $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)

Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java?rev=833861&r1=833860&r2=833861&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
Sun Nov  8 11:54:35 2009
@@ -32,14 +32,21 @@
  * <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 {



Mime
View raw message