Apache9 commented on code in PR #6559:
URL: https://github.com/apache/hbase/pull/6559#discussion_r1896505645
##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##########
@@ -2034,19 +2033,19 @@ void onStartup() throws IOException {
}
@Override
- boolean testRow(final int i, final long startTime) throws IOException,
InterruptedException {
+ boolean testRow(final long i, final long startTime) throws IOException,
InterruptedException {
if (opts.randomSleep > 0) {
Thread.sleep(rd.nextInt(opts.randomSleep));
}
- HRegionLocation hRegionLocation =
-
regionLocator.getRegionLocation(getSplitKey(rd.nextInt(opts.perClientRunRows)),
true);
+ HRegionLocation hRegionLocation = regionLocator.getRegionLocation(
+
getSplitKey(ThreadLocalRandom.current().nextLong(opts.perClientRunRows)), true);
Review Comment:
Ditto.
##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java:
##########
@@ -1881,15 +1880,15 @@ boolean testRow(final int i, final long startTime)
throws IOException {
protected abstract Pair<byte[], byte[]> getStartAndStopRow();
- protected Pair<byte[], byte[]> generateStartAndStopRows(int maxRange) {
- int start = this.rand.nextInt(Integer.MAX_VALUE) % opts.totalRows;
- int stop = start + maxRange;
+ protected Pair<byte[], byte[]> generateStartAndStopRows(long maxRange) {
+ long start = ThreadLocalRandom.current().nextLong(Long.MAX_VALUE) %
opts.totalRows;
Review Comment:
Here we need to use the Random object so we can reproduce the same sequence
when using the same seed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]