[
https://issues.apache.org/jira/browse/HDFS-7949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14385703#comment-14385703
]
Rakesh R commented on HDFS-7949:
--------------------------------
I'd like to take this ahead. Below is my initial thought and could you please
have a look at this when you get a chance. Thanks!
For the file size computation we should consider both data blocks and partity
blocks (for a m + k striped block i.e., m data blocks and k parity blocks).
Since our current strip {{chunkSize}} is fixed (64KB), we should be able to
compute the file size on m, k, and numBytes. I think, we can do the computation
similar to the {{spaceConsumed}} logic. Please correct me if I'm missing
anything.
{code}
for (StripedBlockProto p : f.getStripedBlocks().getBlocksList()) {
size += ((p.getBlock().getNumBytes() - 1) / (p.getDataBlockNum() *
chunkSize) + 1)
* chunkSize * p.getParityBlockNum() + p.getBlock().getNumBytes();
}
{code}
> WebImageViewer need support file size calculation with striped blocks
> ---------------------------------------------------------------------
>
> Key: HDFS-7949
> URL: https://issues.apache.org/jira/browse/HDFS-7949
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Hui Zheng
> Assignee: Rakesh R
> Priority: Minor
>
> The file size calculation should be changed when the blocks of the file are
> striped in WebImageViewer.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)