LiuGuH opened a new pull request, #9003:
URL: https://github.com/apache/hadoop/pull/9003
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'HADOOP-17799. Your PR title ...'.
3. The "Build" check on your PR mirrors CI that runs in your own fork.
Enable GitHub Actions in your fork before your first push:
https://github.com/apache/hadoop/blob/trunk/.github/pr-build-check.md
-->
### Description of PR
WebImageViewer's GETCONTENTSUMMARY computed spaceConsumed as
length * replication. For erasure-coded files the replication factor is 1,
so parity bytes were omitted and the offline result disagreed with the
online NameNode.
This patch makes the offline image viewer load the ERASURE_CODING section
from the fsimage and compute striped file consumption with
StripedBlockUtil.spaceConsumedByStripedBlock, matching
INodeFile.storagespaceConsumedStriped().
### How was this patch tested?
add a test file TestOfflineImageViewerForEC
### For code changes:
- FSImageLoader: parse the ERASURE_CODING section into
ErasureCodingPolicyManager; add getStorageSpaceConsumed(INodeFile) and use
it in getContentSummaryMap and fillDirSummary.
- PBImageTextWriter: also load the ERASURE_CODING section.
- Add TestOfflineImageViewerForEC covering content summaries for striped
files of several shapes and a replicated file, plus unit tests for
getStorageSpaceConsumed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]