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

Sanjay Radia commented on HADOOP-9631:
--------------------------------------

Here are two early comments (haven't finished reviewing the whole patch).
* viewfs#getServerDefaults(path) can be simplified. See how open or list  are 
implemented and it take advantage of  the internal class InternalDirOfViewOf.
Something like this should work:
{code}
viewfs#getServerDefaults(f) {
  InodeTree.ResolveResult<AbstractFileSystem> res = 
        fsState.resolve(getUriPath(f), true);
    return res.targetFileSystem.getServerDefailts(res.remainingPath);
}


InternalDirOfViewFs#getServerDefaults() {
return LocalConfigKeys.getServerDefaults();
}
InternalDirOfViewFs#getServerDefaults(f) {
    checkPathIsSlash(f);
return LocalConfigKeys.getServerDefaults();
}
{code}

 * FIleSystem#getServerDefaults(f) is incorrect due to getDefaultReplication(). 
It should use getDefaultReplciation(f). Hence move the code for 
FIleSystem#getServerDefaults() to FIleSystem#getServerDefaults(f), changing the 
getDefaultReplication to pass the pathname f. Have 
FIleSystem#getServerDefaults() call FIleSystem#getServerDefaults("/");

> ViewFs should use underlying FileSystem's server side defaults
> --------------------------------------------------------------
>
>                 Key: HADOOP-9631
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9631
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, viewfs
>    Affects Versions: 2.0.4-alpha
>            Reporter: Lohit Vijayarenu
>         Attachments: HADOOP-9631.trunk.1.patch, HADOOP-9631.trunk.2.patch, 
> HADOOP-9631.trunk.3.patch, HADOOP-9631.trunk.4.patch, TestFileContext.java
>
>
> On a cluster with ViewFS as default FileSystem, creating files using 
> FileContext will always result with replication factor of 1, instead of 
> underlying filesystem default (like HDFS)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to