junegunn commented on code in PR #6559:
URL: https://github.com/apache/hbase/pull/6559#discussion_r1897565676
##########
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:
I see, but if I'm not mistaken, we currently don't have any test case that
depends on the repeatability of the random sequence. i.e. there is no code in
`TestPerformanceEvaluation` that touches `EnvironmentEdgeManager`.
Also, the original comment states that the purpose of the seeding was to
ensure that each thread gets a different random sequence, which can be nicely
handled by using `ThreadLocalRandom` instead. See
https://github.com/apache/hbase/commit/685d6093b0bd8a1e3f6be20aa5dbbf4d4d30d0ab.
So I figured we could just remove the seeding. Do you still think we need to
use a Random object that can receive a seed? Please let me know if I'm missing
something. Thanks.
--
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]