duongkame commented on code in PR #4772:
URL: https://github.com/apache/ozone/pull/4772#discussion_r1210985106


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OzoneClientKeyReadWriteOps.java:
##########
@@ -229,15 +236,20 @@ public TaskType decideReadOrWriteTask() {
 
   public String getKeyName() {
     StringBuilder keyNameSb = new StringBuilder();
-    int randomIdxWithinRange = ThreadLocalRandom.current().
-            nextInt(startIndex, startIndex + range);
+    int next;
+    if (linear) {
+      next = nextNumber.getAndUpdate(x -> (x + 1) % (startIndex + range + 1));

Review Comment:
   Does this result in a number in the range of `[0, startIndex + range]`, 
while we actually want a sequential cursor in the range [startIndex, range)?
   
   If that's true, something like the below could work
   ```
      next = nextNumber.increaseAndGet() % range + startIndex;
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to