[
https://issues.apache.org/jira/browse/HBASE-11045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976573#comment-13976573
]
Steve Loughran commented on HBASE-11045:
----------------------------------------
{{FileSystem#createNonRecursive()}} isn't implemented by many filesystems,
using it would run the risk of hitting implementations that don't.
Is there any barrier to using a check for the parent dir existing before
calling create? That's essentially what most filesystems would end up doing
{code}
createNoRecursive(Filesystem fs, Path p) {
if (!fs.exists(p.parent()) throw FileNotFoundException(p.parent())
fs.create(p)
}
{code}
It's not atomic, but if you look closely at the source, it's not atomic in most
FS implementations anyway, including native (mkdirs() isn't atomic there).
> Replace deprecated method FileSystem#createNonRecursive
> -------------------------------------------------------
>
> Key: HBASE-11045
> URL: https://issues.apache.org/jira/browse/HBASE-11045
> Project: HBase
> Issue Type: Task
> Reporter: Gustavo Anatoly
> Assignee: Gustavo Anatoly
> Priority: Minor
> Fix For: 0.99.0
>
>
> This change affect directly ProtobufLogWriter#init() associated to
> TestHLog#testFailedToCreateHLogIfParentRenamed.
--
This message was sent by Atlassian JIRA
(v6.2#6252)