Skip to content

Commit c80ecfd

Browse files
committed
Fix TestMiniClusterLoadParallel related failures
1 parent c2dc14b commit c80ecfd

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

hbase-common/src/test/java/org/apache/hadoop/hbase/util/LoadTestKVGenerator.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@
3333
public class LoadTestKVGenerator {
3434

3535
private static final Logger LOG = LoggerFactory.getLogger(LoadTestKVGenerator.class);
36-
private static final Random RNG = new Random();
3736
private static int logLimit = 10;
3837

3938
/** A random number generator for determining value size */
40-
private final Random randomForValueSize = new Random();
39+
private Random randomForValueSize = new Random();
4140

4241
private final int minValueSize;
4342
private final int maxValueSize;
@@ -111,9 +110,9 @@ private static byte[] getValueForRowColumn(int dataSize, byte[]... seedStrings)
111110
seed += bytesString.hashCode();
112111
}
113112
}
114-
RNG.setSeed(seed);
113+
Random seededRandom = new Random(seed);
115114
byte[] randomBytes = new byte[dataSize];
116-
RNG.nextBytes(randomBytes);
115+
seededRandom.nextBytes(randomBytes);
117116
return randomBytes;
118117
}
119118

0 commit comments

Comments
 (0)