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

Andrew Wang commented on HDFS-11072:
------------------------------------

IIUC EC policy is implemented by traversing the target path backwards until we 
find a directory with a policy set. This is how storage policies work at least. 
Reusing Sammi's example:

{noformat}
mkdir -p /A/B/C
erasurecode -setPolicy thepolicy /A
{noformat}

Files created under A, B, or C all will inherit the policy set on A. If we 
wanted to change the policy, we just call {{-setPolicy}} again on A and it will 
be picked up by new files. Basically, the default policy is to inherit from the 
parent.

bq.  In that case, do we need to care about the replication factor. IIUC, the 
directory doesn't have the replication factor. Am I missing anything?

You're correct, there isn't a replication factor specified. I just wanted to 
clarify with Sammi earlier, since there was a mention of "3x replicated" 
specifically, when really it can be general.

bq. Probably we could make this function call simple and apply the changes only 
to the given directory. If user wants, then let them iterate and call this 
function multiple times.

+1. It might also be nice to provide a CLI tool that prints the policies on the 
parent directories of a path.

bq,  Instead of adding new "replicated" EC policy, how about call unset EC 
policy on a directory and the new files under this will now start writing in 
replicated fashion.

Hopefully the above example clarified this, but basically if we want a subdir 
of a directory with an EC policy (e.g. {{/A/B/R}}) to create replicated files, 
we need to set a policy that's not the default "inherit from parent" policy.

> Add ability to unset and change directory EC policy
> ---------------------------------------------------
>
>                 Key: HDFS-11072
>                 URL: https://issues.apache.org/jira/browse/HDFS-11072
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: erasure-coding
>    Affects Versions: 3.0.0-alpha1
>            Reporter: Andrew Wang
>            Assignee: SammiChen
>              Labels: hdfs-ec-3.0-must-do
>
> Since the directory-level EC policy simply applies to files at create time, 
> it makes sense to make it more similar to storage policies and allow changing 
> and unsetting the policy.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to