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

Manoj Govindassamy commented on HDFS-11912:
-------------------------------------------

continuation of my review comments...
8. 
{noformat}
    // Get list of snapshottable directories
    SnapshottableDirectoryStatus[] snapshottableDirectoryStatus = 
hdfs.getSnapshottableDirListing();
    for (SnapshottableDirectoryStatus ssds : snapshottableDirectoryStatus) {
      snapshottableDirectories.add(ssds.getFullPath());
    }
{noformat}
Above code is a no-op as the test hasn't set up any allow snapshots on any 
directories yet. Can we remove the block ?

9.
There is only one entry in {{snapshottableDirectories}} list, which is the home 
directory. Still, many places in the test try to pick up a random entry from 
this list. Is it really needed?

10.
{noformat}
  /** Delete an existing test directory */
  private void deleteTestDir() throws IOException {
    if (snapshottableDirectories.size() > 0) {
      int index = GENERATOR.nextInt(snapshottableDirectories.size());
      Path deleteDir = snapshottableDirectories.get(index);

      if (!pathToSnapshotsMap.containsKey(deleteDir)) {
           .. .. // deletion
      }
{noformat}
{{deleteTestDir}} and {{renameTestDir}} have the above model where the deletion 
or rename task is only performed when directory does not exist in 
{{pathToSnapshotsMap}}. But, pathToSnapshotsMap will always have this home dir 
after the first snapshot created. So, deletions and renames will always be 
skipped after the first snapshot taken? 

11. Can you please print the aggregated stats at the end of the test? There is 
a lot of logging happening for every task and we might miss the overall 
picture. It would be good to print the overall stats like total dir creates, 
total dir deletes, total file creates, renames, etc., before every cluster 
evaluation or the end of the test.

12. Please take care of the [checkstyle 
issues|https://builds.apache.org/job/PreCommit-HDFS-Build/19732/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs.txt].
 Most of them are related to the line exceeding 80 chars or the indentation not 
proper. 


> 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
>            Priority: Minor
>         Attachments: HDFS-11912.001.patch
>
>
> Adding a snapshot unit test with randomized file IO operations.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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