You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mike Drob (JIRA)" <ji...@apache.org> on 2017/01/06 16:52:58 UTC

[jira] [Updated] (SOLR-9937) StandardDirectoryFactory::move never uses more efficient implementation

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

Mike Drob updated SOLR-9937:
----------------------------
    Attachment: SOLR-9937.patch

[~markrmiller@gmail.com] - you were last to touch this in SOLR-9902, care to take a look?

> StandardDirectoryFactory::move never uses more efficient 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
>         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