[ 
https://issues.apache.org/jira/browse/HDFS-9341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15034868#comment-15034868
 ] 

Lei (Eddy) Xu commented on HDFS-9341:
-------------------------------------

Hi, [~zhz]. Thanks for working on this. This is an interesting patch and it 
looks good overall. A few small comments

* {code}
byte readSimulatedByte(Block b, long offsetInBlk, boolean slowness) ;
{code}

Should it be private? also {{slowness}} is already a member of 
{{SimulatedInputStream}}, perhaps we do not need to pass it here.

* {code}
 SimulatedInputStream(long l, Block b, boolean slow) {
{code}
Could you update the comments of {{SimulatedInputStream(...)}} to reflect the 
parameters. 

* {{private boolean randomDiskSlowness;}} should be final.

* Should {{SLOWNESS_PROBABILITY}} and {{SLOWNESS_DELAY_MS }} be configurable? 
For example, control "how slow" it is? We can do it in a following JIRA. You 
mentioned that

bq. The slowness can be random or controlled at certain bytes.

Are you going to implement these features in this patch?

Last, a general question: using {{random}} to build slow I/Os is 
non-deterministic. Would it cause problems in unit tests?

Thanks!

> Simulated slow disk in SimulatedFSDataset
> -----------------------------------------
>
>                 Key: HDFS-9341
>                 URL: https://issues.apache.org/jira/browse/HDFS-9341
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 2.7.1
>            Reporter: Zhe Zhang
>            Assignee: Zhe Zhang
>            Priority: Minor
>         Attachments: HDFS-9341.00.patch
>
>
> Besides simulating the byte content, {{SimulatedFSDataset}} can also simulate 
> the scenario where disk is slow when accessing certain bytes. The slowness 
> can be random or controlled at certain bytes. It can also be made 
> configurable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to