[ https://issues.apache.org/jira/browse/HDFS-7866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15048347#comment-15048347 ]
Rui Li commented on HDFS-7866: ------------------------------ I tried to add another system policy (with different schema) and hit the following problem. In {{FSDirErasureCodingOp::getErasureCodingPolicyForPath}}, if the inode is a file, we retrieve the policy by a numeric ID: {{INodeFile::getErasureCodingPolicyID}}. For directories however, the policy is retrieved by name: {code} final XAttrFeature xaf = inode.getXAttrFeature(); if (xaf != null) { XAttr xattr = xaf.getXAttr(XATTR_ERASURECODING_POLICY); if (xattr != null) { ByteArrayInputStream bIn = new ByteArrayInputStream(xattr.getValue()); DataInputStream dIn = new DataInputStream(bIn); String ecPolicyName = WritableUtils.readString(dIn); return fsd.getFSNamesystem().getErasureCodingPolicyManager(). getPolicy(ecPolicyName); } } {code} Therefore the newly added policy works for dirs but not files. I think we need a unified way to store/get a policy. Any thoughts? > Erasure coding: NameNode manages EC schemas > ------------------------------------------- > > 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 > > > 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)