hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-4160) libhdfs / fuse-dfs should implement O_CREAT | O_EXCL
Date Wed, 29 May 2013 17:08:22 GMT

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

Colin Patrick McCabe commented on HDFS-4160:

This patch implements passing {{overwrite = false}} when we're creating a file with {{O_EXCL}}.

I also took the liberty of cleaning up a few other things.  The exception matching logic was
busted, since it was looking for class names with slashes in them, whereas {{classNameOfObject}}
returns class names with dots (ultimately this comes from {{GetMethodID}}).  I wrote this
logic originally, and I don't know what I was thinking.  Fixing this also lets us get rid
of the hack in {{hdfs_json_parser.c}} where we convert dots to slashes.

{{EIO}} is also a better error code to return if we don't know the exception we were given
than {{EINTERNAL}}.  The latter should be reserved for things like JNI internal errors, not

I added {{FileAlreadyExistsException}} to the list of exceptions we're catching and translating.
 It translates to EEXIST.

I added a unit test for {{O_EXCL}} in {{test_libhdfs_threaded}}.  I fixed a few cases where
we were printing out test errors without prefixing them with {{TEST_ERROR}} (if we don't do
this, they get lost in the noise).
> libhdfs / fuse-dfs should implement O_CREAT | O_EXCL
> ----------------------------------------------------
>                 Key: HDFS-4160
>                 URL: https://issues.apache.org/jira/browse/HDFS-4160
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: libhdfs
>    Affects Versions: 2.0.3-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>         Attachments: HDFS-4160.001.patch
> {{hdfsOpenFile}} contains this code:
> {code}
> if ((flags & O_CREAT) && (flags & O_EXCL)) {                        
>   fprintf(stderr, "WARN: hdfs does not truly support O_CREATE && O_EXCL\n");
> } 
> {code}
> But {{hdfsOpenFile}} could easily support *O_CREAT* | *O_EXCL* by calling {{FileSystem#create}}
with {{overwrite = false}}.
> We should do this.  It would also benefit {{fuse-dfs}}.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message