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

Rui Li commented on HDFS-7866:
------------------------------

Thanks [~drankye] for the review!
1. Sure, will do.
2. Since the system policies are static members, they'll have the same ID after 
NN restarts. But I agree it's better not to let {{ErasureCodingPolicy}} 
generate the ID itself. How about pass the ID to it as a constructor parameter, 
and have the ID generator in {{ErasureCodingPolicyManager}}?
3. Currently striped files all have 0 as the replication factor. E.g. in the 
INodeFile part of the patch:
{code}
-      // Replication factor for striped files is zero
+      // For erasure coded files, replication is used to store ec policy id
+      if (isStriped) {
+        Preconditions.checkArgument(replication >= 0);
+      }
+      h = REPLICATION.BITS.combine(replication, h);
       if (isStriped) {
-        h = REPLICATION.BITS.combine(0L, h);
         h = IS_STRIPED.BITS.combine(1L, h);
       } else {
-        h = REPLICATION.BITS.combine(replication, h);
         h = IS_STRIPED.BITS.combine(0L, h);
       }
{code}
With the patch, striped file's replication factor is actually the policy ID. 
The modification you mentioned in {{HdfsFileStatus}} is to avoid confusing 
users by displaying policy ID as replication factor.
4. {{QUEUE_VERY_UNDER_REPLICATED}} means the current redundancy is 1/3 of 
desired redundancy. So I changed the comment to be consistent with the code. 
You can refer to discussions in HDFS-8461.
5. Which map do you think we should keep?

> 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, HDFS-7866.4.patch, HDFS-7866.5.patch, HDFS-7866.6.patch, 
> HDFS-7866.7.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)

Reply via email to