diff --git a/CHANGES.txt b/CHANGES.txt index 1adf21d90eb..b3beb7cbe80 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java index 9e01d558a03..22a9b4ed409 100644 --- a/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java +++ b/core/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java @@ -96,7 +96,7 @@ public class PerformanceEvaluation implements HConstants { 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 implements HConstants { * 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;