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

Lin Yiqun updated HDFS-9673:
----------------------------
    Description: 
In method {{FSNamesystem#checkFileProgress}}, the annotation of this method is 
not complete. When check penultimate block and the penultimate block not exist, 
it will also return true. But the annotation of this special case is not  
referred. And that will be misunderstanding for users. The current annotation 
of method {{checkFileProgress}}:
/**
   * Check that the indicated file's blocks are present and
   * replicated.  If not, return false. If checkall is true, then check
   * all blocks, otherwise check only penultimate block.
   */
  boolean checkFileProgress(String src, INodeFile v, boolean checkall) {
    assert hasReadLock();
    if (checkall) {
      return blockManager.checkBlocksProperlyReplicated(src, v
          .getBlocks());
    } else {
      // check the penultimate block of this file
      BlockInfo b = v.getPenultimateBlock();
      return b == null ||
          blockManager.checkBlocksProperlyReplicated(
              src, new BlockInfo[] { b });
    }
  }
{code}

  was:In method {{FSNamesystem#checkFileProgress}}, the annotation of this 
method is not complete. When check penultimate block and the penultimate block 
not exist, it will also return true. But the annotation of this special case is 
not  referred. And that will be misunderstanding for users.


> Incomplete annotation in FSNamesystem#checkFileProgress
> -------------------------------------------------------
>
>                 Key: HDFS-9673
>                 URL: https://issues.apache.org/jira/browse/HDFS-9673
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.7.1
>            Reporter: Lin Yiqun
>            Assignee: Lin Yiqun
>            Priority: Trivial
>
> In method {{FSNamesystem#checkFileProgress}}, the annotation of this method 
> is not complete. When check penultimate block and the penultimate block not 
> exist, it will also return true. But the annotation of this special case is 
> not  referred. And that will be misunderstanding for users. The current 
> annotation of method {{checkFileProgress}}:
> /**
>    * Check that the indicated file's blocks are present and
>    * replicated.  If not, return false. If checkall is true, then check
>    * all blocks, otherwise check only penultimate block.
>    */
>   boolean checkFileProgress(String src, INodeFile v, boolean checkall) {
>     assert hasReadLock();
>     if (checkall) {
>       return blockManager.checkBlocksProperlyReplicated(src, v
>           .getBlocks());
>     } else {
>       // check the penultimate block of this file
>       BlockInfo b = v.getPenultimateBlock();
>       return b == null ||
>           blockManager.checkBlocksProperlyReplicated(
>               src, new BlockInfo[] { b });
>     }
>   }
> {code}



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

Reply via email to