lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Drob (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SOLR-9937) StandardDirectoryFactory::move never uses atomic implementation
Date Mon, 09 Jan 2017 23:16:58 GMT

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

Mike Drob resolved SOLR-9937.
-----------------------------
    Resolution: Duplicate

> StandardDirectoryFactory::move never uses atomic implementation
> ---------------------------------------------------------------
>
>                 Key: SOLR-9937
>                 URL: https://issues.apache.org/jira/browse/SOLR-9937
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Mike Drob
>            Assignee: Mark Miller
>         Attachments: SOLR-9937.patch
>
>
> {noformat}
>       Path path1 = ((FSDirectory) baseFromDir).getDirectory().toAbsolutePath();
>       Path path2 = ((FSDirectory) baseFromDir).getDirectory().toAbsolutePath();
>       
>       try {
>         Files.move(path1.resolve(fileName), path2.resolve(fileName), StandardCopyOption.ATOMIC_MOVE);
>       } catch (AtomicMoveNotSupportedException e) {
>         Files.move(path1.resolve(fileName), path2.resolve(fileName));
>       }
> {noformat}
> Because {{path1 == path2}} this code never does anything and move always defaults to
the less efficient implementation in DirectoryFactory.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message