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

George Huang commented on HDFS-11912:
-------------------------------------

Hi Manoj,

Thank you for the code review and great feedback! Please see below,

1. Operation type, just like weight can be part of the constructor and we can 
avoid checking the value string starting with to identify the operation and get 
random operations.
==> Fixed

2. Random operation initialization in line 153 and line 157 are not needed.
==> Fixed

3. In createFile, line 616, the loop limit says TOTAL_BLOCKS, but it is infact 
treated like max file count.
==> Changed to TOTAL_FILECOUNT

4. In createFile, line 607, some top level directory might have been set as 
snapshotable earlier. Later when you enable snapshot for a nested directory 
under it, the call can fail with below exception. Are you ignoring the 
exception?
==> Great catch. In this case, we'll swallow the exception. This should be fine.

5. Line 280, we can assert here. Otherwise, there is an issue with creating 
random operation.
6. Line 304, same here.
==> Sure. This should not happen. We'll assert the option is null, which is the 
initial value. Any none null value would be an error if it fall into here.

7. Line 318, we can add a unique number suffix to the created directory so as 
to differentiate where the failure happened
8. Line 366, rename dir suffix can also take a unique number for 
differentiation.
==> Fixed

9. Line 551, 552: Aren't FileStatus[] from listStatus already sorted ? can you 
please check?
==> Trying to find if anywhere document whether the return set is sorted. For 
example apache link at here: 
https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/FileSystem.html#listStatus(org.apache.hadoop.fs.Path)

Does not see if's mentioning the return set is sorted. It is implementation 
specific I assume. Therefore, to be implementation independent, we''ll keep the 
sorting as is.

Many thanks,
George

> Add a snapshot unit test with randomized file IO operations
> -----------------------------------------------------------
>
>                 Key: HDFS-11912
>                 URL: https://issues.apache.org/jira/browse/HDFS-11912
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: hdfs
>            Reporter: George Huang
>            Assignee: George Huang
>            Priority: Minor
>              Labels: TestGap
>         Attachments: HDFS-11912.001.patch, HDFS-11912.002.patch
>
>
> Adding a snapshot unit test with randomized file IO operations.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to