ermahesh commented on code in PR #11219:
URL: https://github.com/apache/ozone/pull/11219#discussion_r4008583858


##########
hadoop-ozone/freon/src/main/java/org/apache/hadoop/ozone/freon/HadoopFsReadWriteValidator.java:
##########
@@ -89,6 +110,18 @@ public class HadoopFsReadWriteValidator extends 
HadoopBaseFreonGenerator
       defaultValue = "10000")
   private int maxFilesPerThread;
 
+  @Option(names = {"--reads-per-write"},
+      description = "Number of validation reads issued per write. 1 pairs one 
read with every write, 4 makes the "
+          + "run read-heavy with four validation reads per write, and 0.25 
makes it write-heavy with one read "
+          + "every fourth write. Every read picks a file the thread wrote at 
random, so this changes how many "
+          + "files a task validates, not which write it validates. A value 
that is not a whole number is spread "
+          + "over the writes of a thread rather than rounded on every one of 
them.",
+      defaultValue = "1.0")
+  private BigDecimal readsPerWrite;

Review Comment:
   Done in `a38f87273e`: `--read-percent` (default 50), with 
`ThreadLocalRandom.current().nextDouble(100) < readPercent` drawn per 
operation. `-n` now counts operations of both kinds rather than writes alone, 
so the split holds over a run rather than exactly.
   
   Two things the ratio model got for free needed holding explicitly. A thread 
whose history is still empty has nothing to read and writes instead, which is 
why a 100 percent run still shows one write per thread. And the file a write 
goes to is now named after the write sequence in the thread's own marker rather 
than the task counter, since that counter no longer counts the thread's writes; 
this keeps a thread within `--max-files-per-thread` however the draws fall.
   
   The tests assert the split within six standard deviations of the draw over 
1000 operations, plus exact counts at 0 and 100 percent.



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