hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r922070 - in /hadoop/hbase/trunk: CHANGES.txt core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
Date Thu, 11 Mar 2010 23:33:54 GMT
Author: stack
Date: Thu Mar 11 23:33:53 2010
New Revision: 922070

URL: http://svn.apache.org/viewvc?rev=922070&view=rev
Log:
HBASE-2268 PerformanceEvaluation --nomapred may assign duplicate random seed over multiple
testing threads

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=922070&r1=922069&r2=922070&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Mar 11 23:33:53 2010
@@ -233,6 +233,8 @@ Release 0.21.0 - Unreleased
                (dhruba borthakur via Stack)
    HBASE-2308  Fix the bin/rename_table.rb script, make it work again
    HBASE-2307  hbase-2295 changed hregion size, testheapsize broke... fix it
+   HBASE-2269  PerformanceEvaluation "--nomapred" may assign duplicate random
+               seed over multiple testing threads (Tatsuya Kawano via Stack)
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java?rev=922070&r1=922069&r2=922070&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
(original)
+++ hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
Thu Mar 11 23:33:53 2010
@@ -96,7 +96,7 @@ public class PerformanceEvaluation imple
   public static final byte [] FAMILY_NAME = Bytes.toBytes("info");
   public static final byte [] QUALIFIER_NAME = Bytes.toBytes("data");
   
-  protected HTableDescriptor TABLE_DESCRIPTOR; {
+  protected static HTableDescriptor TABLE_DESCRIPTOR; {
     TABLE_DESCRIPTOR = new HTableDescriptor("TestTable");
     TABLE_DESCRIPTOR.addFamily(new HColumnDescriptor(FAMILY_NAME));
   }
@@ -539,8 +539,15 @@ public class PerformanceEvaluation imple
    * A test.
    * Subclass to particularize what happens per row.
    */
-  abstract class Test {
-    protected final Random rand = new Random(System.currentTimeMillis());
+  static abstract class Test {
+    // Below is make it so when Tests are all running in the one
+    // jvm, that they each have a differently seeded Random. 
+    private static final Random randomSeed =
+      new Random(System.currentTimeMillis());
+    private static long nextRandomSeed() {
+      return randomSeed.nextLong();
+    }
+    protected final Random rand = new Random(nextRandomSeed());
     protected final int startRow;
     protected final int perClientRunRows;
     protected final int totalRows;



Mime
View raw message