hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghu Angadi (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HADOOP-1910) Extra checks in DFS.create() are not necessary.
Date Mon, 17 Sep 2007 21:57:43 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-1910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Raghu Angadi reassigned HADOOP-1910:
------------------------------------

    Assignee: Raghu Angadi

> Extra checks in DFS.create() are not necessary.
> -----------------------------------------------
>
>                 Key: HADOOP-1910
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1910
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>            Priority: Minor
>         Attachments: HADOOP-1910.patch
>
>
> {{DistributedFileSystem.create(path)}} like this :
> {code}
>   public FSDataOutputStream create(Path f, boolean overwrite,
>     int bufferSize, short replication, long blockSize,
>     Progressable progress) throws IOException {
>     if (exists(f) && !overwrite) {
>       throw new IOException("File already exists:"+f);
>     }
>     Path parent = f.getParent();
>     if (parent != null && !exists(parent) && !mkdirs(parent)) {
>       throw new IOException("Mkdirs failed to create " + parent);
>     }
>     return new FSDataOutputStream( dfs.create(getPathName(f), overwrite, 
>                                               replication, blockSize, 
>                                               progress, bufferSize, ticket));
>   }
> {code}
> This has overhead of 2-3 RPCs to namenode for every create(). The first {{exists()}}
is not required because {{overwrite}} flag is passed to Namenode. The second {{exists()}}
and {{mkdirs()}} is not required since {{create()}} already does this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message