[ https://issues.apache.org/jira/browse/HDFS-7866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15183118#comment-15183118 ]
Walter Su commented on HDFS-7866: --------------------------------- What do you think let it diverge instead of forcing unification? It takes more time to understand the new format from the code. I think add some javadoc would be nice. How about like this: {noformat} /** * Bit format: * [4-bit storagePolicyID][12-bit BLOCK_LAYOUT_AND_REDUNDANCY] * [48-bit preferredBlockSize] * * BLOCK_LAYOUT_AND_REDUNDANCY format for replicated block: * 0 [11-bit replication] * * BLOCK_LAYOUT_AND_REDUNDANCY format for striped block: * 1 [11-bit ErasureCodingPolicy ID] * */ {noformat} I think getErasureCodingPolicyID() don't have to re-use getReplication(long header). Even though now they are both 11-bits. In the future, We might keep split 11-bit ec policy ID. The 2 methods keep diverging. I guess something like, {noformat} /** * Bit format: * [4-bit storagePolicyID][12-bit BLOCK_LAYOUT_AND_REDUNDANCY] * [48-bit preferredBlockSize] * * BLOCK_LAYOUT_AND_REDUNDANCY format for non-ec block: * 0 [11-bit replication] * * BLOCK_LAYOUT_AND_REDUNDANCY format for ec striped block: * 10 [4-bit replication][6-bit ErasureCodingPolicy ID] * * BLOCK_LAYOUT_AND_REDUNDANCY format for ec contiguous block: * 11 [4-bit replication][6-bit ErasureCodingPolicy ID] * */ {noformat} And I think we should reserve some high-value ID for custom policy. And reserve some for unknown policy which might intergrated(hard-coded) in the future. > Erasure coding: NameNode manages multiple erasure coding policies > ----------------------------------------------------------------- > > Key: HDFS-7866 > URL: https://issues.apache.org/jira/browse/HDFS-7866 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Kai Zheng > Assignee: Rui Li > Attachments: HDFS-7866-v1.patch, HDFS-7866-v2.patch, > HDFS-7866-v3.patch, HDFS-7866.10.patch, HDFS-7866.11.patch, > HDFS-7866.12.patch, HDFS-7866.4.patch, HDFS-7866.5.patch, HDFS-7866.6.patch, > HDFS-7866.7.patch, HDFS-7866.8.patch, HDFS-7866.9.patch > > > This is to extend NameNode to load, list and sync predefine EC schemas in > authorized and controlled approach. The provided facilities will be used to > implement DFSAdmin commands so admin can list available EC schemas, then > could choose some of them for target EC zones. -- This message was sent by Atlassian JIRA (v6.3.4#6332)