You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Hongbing Wang (Jira)" <ji...@apache.org> on 2024/05/12 17:31:00 UTC

[jira] [Resolved] (HDDS-10846) ozone freon ockrw accurately divides the ratio of tasks when mixed operations

     [ https://issues.apache.org/jira/browse/HDDS-10846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hongbing Wang resolved HDDS-10846.
----------------------------------
    Resolution: Not A Problem

> 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-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org