[ https://issues.apache.org/jira/browse/HDDS-10846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17845738#comment-17845738 ]
Hongbing Wang commented on HDDS-10846: -------------------------------------- Sry, Not a problem. The frequency of executing `decideReadWriteOrListTask()` is determined by the total number of tasks ( Number of the generated objects, "-n", "--number-of-tests"), which tends to be so large that using random ratios will not pose an issue. > ozone freon ockrw accurately divides the ratio of tasks when mixed operations > ----------------------------------------------------------------------------- > > Key: HDDS-10846 > URL: https://issues.apache.org/jira/browse/HDDS-10846 > Project: Apache Ozone > Issue Type: Improvement > Components: freon > Affects Versions: 1.4.0 > Reporter: Hongbing Wang > Assignee: Hongbing Wang > Priority: Major > > Current code: > {code:java} > public TaskType decideReadWriteOrListTask() { > int tmp = ThreadLocalRandom.current().nextInt(1, 101); > if (tmp <= percentageRead) { > return TaskType.READ_TASK; > } else if (tmp <= percentageRead + percentageList) { > return TaskType.LIST_TASK; > } else { > return TaskType.WRITE_TASK; > } > } {code} > using random numbers to divides tasks is not accurate, especially when the > number of threads is small. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org