[
https://issues.apache.org/jira/browse/HADOOP-11452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16743963#comment-16743963
]
Steve Loughran commented on HADOOP-11452:
-----------------------------------------
bq. I want to just highlight the fact that, both API's behavior is different in
HDFS NameNode side in case of destination is a directory and already exists.
Thanks for clarifying this that linux shell vs posix rename() semantics is one
of the great sources of confusion. Its as if none of us quite understand what
rename is meant to do. oops.
I'm in favour of going with the stricter semantics here and documenting/testing
them. More specifically, by writing down what happens today and opening it up,
it make it possible for people to use a rename operation which fails
meaningfully and is already available/tested.
The call itself indirectly visible, as its called by DelegateToFileSystem,
AbstractFileSystem and hence FileContext. But the actual setting up of those
parameters seems a bit restricted there.
> Make FileSystem.rename(path, path, options) public, specified, tested
> ---------------------------------------------------------------------
>
> Key: HADOOP-11452
> URL: https://issues.apache.org/jira/browse/HADOOP-11452
> Project: Hadoop Common
> Issue Type: Task
> Components: fs
> Affects Versions: 2.7.3
> Reporter: Yi Liu
> Assignee: Steve Loughran
> Priority: Major
> Attachments: HADOOP-11452-001.patch, HADOOP-11452-002.patch,
> HADOOP-14452-004.patch, HADOOP-14452-branch-2-003.patch
>
>
> Currently in {{FileSystem}}, {{rename}} with _Rename options_ is protected
> and with _deprecated_ annotation. And the default implementation is not
> atomic.
> So this method is not able to be used outside. On the other hand, HDFS has a
> good and atomic implementation. (Also an interesting thing in {{DFSClient}},
> the _deprecated_ annotations for these two methods are opposite).
> It makes sense to make public for {{rename}} with _Rename options_, since
> it's atomic for rename+overwrite, also it saves RPC calls if user desires
> rename+overwrite.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]