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

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

Hi, [~twu]

Thanks for working on this.  It looks good overall. Just a few small comments:

{code}
   * @return true if the metadata was corrupted, false otherwise.
*/
public void deleteMeta(int i, ExtendedBlock blk)
{code}

Please revise the comments to reflect code change.

{code}
System.out.println("Deliberately removing meta for block " + eb);
{code}

We can use {{LOG.info}} here.

{code}
assertTrue("File length is " + newFileLen + " expecting " +
                  expectedNewFileLen, newFileLen == expectedNewFileLen);
{code}

Lets use {{assertEqual}} here and make the second line indent correctly.

+1 once addressed above comments.

> Add truncateMeta() and deleteMeta() to MiniDFSCluster
> -----------------------------------------------------
>
>                 Key: HDFS-9308
>                 URL: https://issues.apache.org/jira/browse/HDFS-9308
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: HDFS, test
>    Affects Versions: 2.7.1
>            Reporter: Tony Wu
>            Assignee: Tony Wu
>            Priority: Minor
>         Attachments: HDFS-9308.001.patch, HDFS-9308.002.patch
>
>
> HDFS-9188 introduced {{corruptMeta()}} method to make corrupting the metadata 
> file filesystem agnostic. There should also be a {{truncateMeta()}} and 
> {{deleteMeta()}} method in MiniDFSCluster to allow truncation of metadata 
> files on DataNodes without writing code that's specific to underling file 
> system. {{FsDatasetTestUtils#truncateMeta()}} is already implemented by 
> HDFS-9188 and cam be exposed easily in {{MiniDFSCluster}}.
> This will be useful for tests such as 
> {{TestLeaseRecovery#testBlockRecoveryWithLessMetafile}} and 
> {{TestCrcCorruption#testCrcCorruption}}.



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

Reply via email to