hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhe Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7826) Erasure Coding: Update INodeFile quota computation for striped blocks
Date Thu, 05 Mar 2015 00:10:39 GMT

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

Zhe Zhang commented on HDFS-7826:
---------------------------------

Oops I didn't realize this JIRA handles {{computeFileSize}}. I was about to suggest the following
code under HDFS-7749. 
{code}
  public final long computeFileSize(boolean includesLastUcBlock,
      boolean usePreferredBlockSize4LastUcBlock) {
    BlockInfo[] blocksInfile = isStriped() ?
        getStripedBlocksFeature().getBlocks() : blocks;
    if (blocksInfile == null || blocksInfile.length == 0) {
      return 0;
    }
    final int last = blocksInfile.length - 1;
    //check if the last block is BlockInfoUnderConstruction
    long size = blocksInfile[last].getNumBytes();
    if (blocksInfile[last] instanceof BlockInfoContiguousUnderConstruction ||
        blocksInfile[last] instanceof BlockInfoStripedUnderConstruction) {
       if (!includesLastUcBlock) {
         size = 0;
       } else if (usePreferredBlockSize4LastUcBlock) {
         size = getPreferredBlockSize();
       }
    }
    //sum other blocks
    for(int i = 0; i < last; i++) {
      size += blocksInfile[i].getNumBytes();
    }
    return size;
  }
{code}

> Erasure Coding: Update INodeFile quota computation for striped blocks
> ---------------------------------------------------------------------
>
>                 Key: HDFS-7826
>                 URL: https://issues.apache.org/jira/browse/HDFS-7826
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Jing Zhao
>            Assignee: Kai Sasaki
>         Attachments: HDFS-7826.1.patch
>
>
> Currently INodeFile's quota computation only considers contiguous blocks (i.e., {{INodeFile#blocks}}).
We need to update it to support striped blocks.



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

Mime
View raw message