[
https://issues.apache.org/jira/browse/BEAM-4861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16594794#comment-16594794
]
Tim Robertson edited comment on BEAM-4861 at 8/28/18 10:33 AM:
---------------------------------------------------------------
On further inspection I think {{delete}} is correct to swallow a {{false}}
response [~JozoVilcek]
* A {{delete}} for example will return {{false}} when you try and delete a non
existing file which seems reasonable to swallow. It will throw exception for
the scenarios that mater.
The {{copy}} seems indifferent, so we might as well throw exception to be
cautious:
* The {{copy}} returns false only if there is issue with {{mkdirs}} and the
HDFS docs [1] state that it always returns true.
For {{rename()}} we can create the directory if not existing and then should
throw exception on any response that is false.
[1]
[https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/filesystem/filesystem.html#boolean_renamePath_src_Path_d]
was (Author: timrobertson100):
On further inspection I think {{delete}} and {{copy}} are correct to swallow a
{{false}} response [~JozoVilcek]
* A {{delete}} for example will return {{false}} when you try and delete a non
existing file which seems reasonable to swallow. It will throw exception for
the scenarios that mater.
* The {{copy}} returns false only if there is issue with {{mkdirs}} and the
HDFS docs [1] state that it always returns true even if the directory is not
created [1] I think we can ignore the local filesystem implementation.
For {{rename()}} we can create the directory if not existing and then should
throw exception on any response that is false.
[1]
[https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/filesystem/filesystem.html#boolean_renamePath_src_Path_d]
> Hadoop Filesystem silently fails
> --------------------------------
>
> Key: BEAM-4861
> URL: https://issues.apache.org/jira/browse/BEAM-4861
> Project: Beam
> Issue Type: Bug
> Components: io-java-hadoop
> Reporter: Jozef Vilcek
> Assignee: Chamikara Jayalath
> Priority: Major
>
> Hi,
> beam Filesystem operations copy, rename and delete are void in SDK. Hadoop
> native filesystem operations are not and returns void. Current implementation
> in Beam ignores the result and pass as long as exception is not thrown.
> I got burned by this when using 'rename' to do a 'move' operation on HDFS. If
> target directory does not exists, operations returns false and do not touch
> the file.
> [https://github.com/apache/beam/blob/master/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopFileSystem.java#L148]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)